First step: Build a git repository
CD to your local project root directory, execute the git command
Git init
Step Two: Add all the files of the project to the warehouse
git Add.
If you want to add a specific file, simply change it to a specific filename.
Step three: Commit the Add file to the repository
git commit-m "comment statement"
At this point, if you see me who is, you need to execute the following command:
git config--global user.email "your email"--global user.name "your name"
Fourth Step: To create your own repository on GitHub, create the page as shown:
Click on the Create repositorybelow, you will go to a page similar to the one below, get the HTTPS address of the warehouse created, the red box is marked
Fifth step: Focus on the local warehouse to GitHub
Git remote add Origin Https://github.com/Chrdai/getUserPriv
The following HTTPS link address is replaced by your own warehouse URL address, which is the red box above the winning address
Sixth step: Before uploading GitHub, pull it first and execute the following command:
Git pull Origin Master
after hitting enter, the output will be executed similar to the following
Seventh step, the last step, upload the code to GitHub remote repository
Git push-u Origin Master
After execution, if there is no exception, wait for the completion of the upload succeeds, the middle may let you enter GitHub username and password, you just enter GitHub's account number and password on the line
If the update file only needs to be executed:
First step: Add the files for the project that need to be updated to the warehouse
Git add ' requires an updated filename '
If you want to add a specific file, simply change it to a specific filename.
Step Two: Commit the Add file to the repository
git commit-m "comment statement"
Step three: Before uploading GitHub, pull a bit and execute the following command:
Git pull Origin Master
Fourth step, update the code to GitHub remote repository
Git push-u Origin Master
git included:https://git-for-windows.github.io/
This article refers to Bo Friends of the blog, with Bo Friends of the original link:http://blog.csdn.net/hanhailong726188/article/details/46738929
If reproduced, please specify the source:http://www.cnblogs.com/chrdai/p/8145153.html
Git uploads local items to GitHub