Upload local code to GitHub

Source: Internet
Author: User

Recently learning Springboot, want to write the demo program saved, so that in the future to use the time to view. Record again how to upload the code to GitHub.

1, to upload the code to GitHub, you need to have a GitHub account, to GitHub registered account, address: https://github.com

2 Create a Git repository, you will see the address of the warehouse when the creation is successful, and the GitHub repository is created.

3 Download the GitHub client, windows:http://msysgit.github.com mac:http://code.google.com/p/tortoisegit can download the specific client and install it according to its operating system, I am downloading windows.

4 Upload your local code to the GitHub repository:

A build a local git repository: CD to your local project root directory (e.g. E:\workSpace\springboot_helloworld), right click on the mouse, click git bashhere, execute git command git init in the current directory, you will see that the local. Git repository file is generated

B Associate the local warehouse with the warehouse on GitHub and execute the command:git remote add Origin https://github.com/wlzq/springboot_helloworld.git

C Add the local file to the local git repository and execute the command:git Add. If you upload a specific file, you will need to '.' Change the file name.

D before upload requires pull, execute command: Git pull Origin Master

E submit the added file to the local git repository and execute the command: git commit-m ' submit comment message '

F Submit the local Git repository to the GitHub repository, execute the command: Git push-u Origin master, you will be prompted to enter the GitHub username and password, enter and hit Enter, you will start uploading the code, upload completed in GitHub will see the file just uploaded.

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.