One, download git client http://git-scm.com/download/
Two create Git account information
1 git config--global user.name "Shulonghu"
git config--global user.email
650) this.width=650; "height=" 142 "src=" https://static.oschina.net/uploads/space/2017/0922/101424_zzpG_3692906. PNG "width=" 444 "style=" Border:none;margin:auto;height:auto; "/>
Three SSH keys for your github account
First check whether the key CD ~/.ssh,ls has been generated, if there are 3 files, the key has been generated, id_rsa.pub is the public key
650) this.width=650; "height=" src= "https://static.oschina.net/uploads/space/2017/0922/101454_Wsmx_3692906.png "Width=" 246 "style=" Border:none;margin:auto;height:auto;/>
If it is not generated, it is generated by $ ssh-keygen-t rsa-c "[email protected]".
1) is the path confirmation, directly press ENTER to save the default path
2) Direct Enter, here we do not use the password to log in, with the password too troublesome;
3) Direct Enter
650) this.width=650; "height=" 282 "src=" https://static.oschina.net/uploads/space/2017/0922/101509_LshX_3692906. PNG "width=" 505 "style=" Border:none;margin:auto;height:auto; "/>
Four common command sequences for git commit warehouses
Git creates a warehouse with the following instructions
Git init//Turn this directory into a repository that git can manage
git Add. Add files to the warehouse
git commit-m "Note description"//Put the file on the warehouse
git remote add origin [email protected]:D the ragontigershu/file name//associated repository
Git push-u origin master//put the local library on all content libraries
Five login GitHub Account
1 Click New repository to create this library. Add rrpository name Name add description information Description
Click Create Repository to finish displaying the repository homepage.
It is important to obtain the address of the remote repository after 2
3 Then open Gitbash
Switch to the HelloWorld project directory and clone the remote repository to a local
Sometimes the transfer time-out is: Just try it a few more times.
650) this.width=650, "height=" https://static.oschina.net/uploads/space/2017/0922/101534_UmoZ_3692906 "src=". PNG "width=" 513 "style=" Border:none;margin:auto;height:auto; "/>
4 after Ls-al view the name of the file created under the project catalog Delete directory
650) this.width=650; "height=" 260 "src=" https://static.oschina.net/uploads/space/2017/0922/101549_mdBZ_3692906. PNG "width=" 513 "style=" Border:none;margin:auto;height:auto; "/>
5 Git push Origin mster synchronous commit this is very important
650) this.width=650; "height=" 407 "src=" https://static.oschina.net/uploads/space/2017/0922/101626_Mn3P_3692906. PNG "width=" 631 "style=" border:none;margin:auto;height:auto; "/>
* Note that if the submission does not come up with an error
Solution Solutions
1 execute under current directory first
Git push-u Origin Master
650) this.width=650; "height=" 370 "src=" https://static.oschina.net/uploads/space/2017/0922/101653_O9Il_3692906. PNG "width=" 582 "style=" Border:none;margin:auto;height:auto; "/>
2 If there is still no solution directory, you must have readme.md files and then merge the form
Execute git pull--rebase origin master
650) this.width=650; "height=" 661 "src=" https://static.oschina.net/uploads/space/2017/0922/101705_zSO9_3692906. PNG "width=" 560 "style=" Border:none;margin:auto;height:auto; "/>
3 Execute a GIT push-u origin master to upload work to GitHub
650) this.width=650; "src=" Https://static.oschina.net/uploads/space/2017/0922/101719_3UFn_3692906.png "style=" Border:none;margin:auto;height:auto; "/>
4 Check the account to see it.
This article is from the "cool Autumn Warm Thinking" blog, please be sure to keep this source http://9603537.blog.51cto.com/9593537/1967700
GitHub Project Upload Steps