Github using git operating in remote warehouse

Created on a github repository, this step reference Liao Xuefeng teacher git tutorials , and other preparatory work a little, I just record a few important commands.

Github clone project from another address

$ git clone [email protected]:xxx/learngit.git
这个xxx就是别人项目的地址

The push their projects to the gitgub

$ git remote add origin [email protected]:lyn4ever/learngit.git

This is their local and remote git associated, after the addition, the library is the name of the remote origin, which is the default name for Git can also be changed to another, but the origin of this name to see that this is a remote database.

$ git push -u origin master

The contents of the local repository pushed to the remote, use git push command, in fact, the current push to the remote master branch.
Because the remote library is empty, the first time we push the master branch, coupled with the -u parameter, Git will not only master the new remote branch content push local master branch, but also the local master branch and remote associated master branch, after the push or pull upon the command can be simplified.

Guess you like

Origin www.cnblogs.com/Lyn4ever/p/10993974.html