Reproduced in: http://blog.csdn.net/hanhailong726188/article/details/46738929
First step: Build a git repository
CD to your local project root directory, execute the git command
Git init
1 1
Step Two: Add all the files of the project to the warehouse
git Add.
1 1
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"
1 1
Fourth step: To create your own repository on GitHub, create a page as shown in the following figure:
Click on the Create repository below, 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/hanhailong/CustomRatingBar
1 1
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
1 1
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
1 1
After execution, if there is no exception, wait for the completion of the upload successfully, the middle may let you enter username and password, you just enter GitHub's account and password on the line
Finally, attach the screenshot after the successful code upload:
Note: If you cannot upload successfully, there are two methods:
1. You can change the command to Git push-u origin master-f (force upload, which may cause code loss in the remote repository)
2. Create a folder with the same name under Master and follow the steps above