Upload local code to GitHub

Source: Internet
Author: User

  1. Right-click on "Git Bash here" in the directory where you want to upload your code;

  2. If SSH is not configured locally, you will need to create an SSH key locally.

    $ ssh-keygen - TRSA- C "Your e-mail address"

  3. Go back to the GitHub page, select "SSH and GPG keys" from the list on the left, and click on the "New SSH key" button to generate the local directory

    Id_rsa.pub the key value in the copy to the Web page, save;

  4. Test if the GitHub connection is successful, enter ssh-t [email protected] in Gitbash;

  5. After the connection is successful, configure the user name and email address for authentication.

    $ git config--global user.name "username"

    $ git config--global user.email "Mailbox"

  6. Git init

  7. git Add. (There are spaces between add and dots)

  8. git commit-m "comment on the commit code"

  9. git remote add origin [email protected]: User name/repo name

  10. Git push Origin master//update local project to GitHub project

Upload local code to GitHub

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.