Submitting items to GitHub under the Windows platform

Source: Internet
Author: User

After the 1.git installation, find Git Bash in the Start menu, something like a command-line window, the initial setup msysgit, simple two commands to do:

git config--global user.name "XXX"

git config--global user.email "XXXXX"

2. To upload a local file to GitHub, you need to create an SSH key locally:

Ssh-keygen-t rsa-c "[Email protected]"

You will then be asked to confirm the path and enter the password, here we go by default. The. SSH folder will be generated in your user directory, then go in, open id_rsa.pub, and copy the key inside.

Go back to GitHub, go to Settings, choose SSH and GPG Keys on the left, click Add SSH keys,title to fill in, paste key.

3. In order to verify that the connection is successful, enter it under GIT bash:

ssh-t [email protected]

If this is the first time you will be prompted whether to continue, enter Yes, and so on, you will see:

Hi xxxxx! You've successfully authenticated, but GitHub doesnot provide shell access.

This means that you have successfully connected to GitHub.

4. Submit your Code

Once you have done this, you can submit your own local code. Locate the local code folder you want to submit, right-click to select Git Bash and build a repository:

Git init

Select the files to add to the warehouse:

git Add.

If you want to share all the code in this folder, add "." After add, and if you specify a file, simply "." Change to a file name.

Add into Warehouse:

Git commit-m "First commit"

The parameter after-M, which indicates that the code is submitted to GitHub, will give a description of the submission, indicating which time I submitted it.

All work is ready, now to be submitted, or a few commands:

Git remote add Origin http://github.com/liyucang/project.git

Git pull Origin Master

Git push Origin Master

Above

Submitting items to GitHub under the Windows platform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.