Git Commands Quick Notes

Fetch

This command is to make sure your local repository has the same knowledge of the remote-tracking branches as the server.

git fetch <remote name>

Check out a Remote Branch

If a new remote branch doesn't have a local branch mapped to it, you need to check out the remote branch locally to work on it. The complete command is,

git checkout -b <local branch name> <remote name>/<remote branch name>

If you want to fetch  all the branches on the server

git branch -v -a

References:

http://*.com/questions/1783405/checkout-remote-git-branch

Push

Push changes to remote. (If the remote doesn't have the branch, the branch will be created)

git push <remote name> <branch name>

Renaming a branch (a complete version of push command)

This can delete a  remote branch by providing empty local branch name.

git push <remote name> <local branch name>:<remote branch name>

References:

https://help.github.com/articles/pushing-to-a-remote/

http://*.com/questions/2765421/push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too

上一篇:第一次在线latex的使用


下一篇:NoSQL数据库技术实战-第1章 NoSQL与大数据简介 NoSQL产生的原因