Sometimes you need to get the code for a remote branch from a remote git server, and the command is git fetch Origin remote-branch:local-branch, which is easier to forget, especially recorded.
1. View Remote repositories
Git remote-voriginhttp://git.dev.qianmi.com/elifeapp/weidian.git (Fetch) Originhttp://git.dev.qianmi.com/elifeapp /weidian.git (push)
2.get the latest version from remote to local
Git fetch Origin Master:temp
This command means: Download from the master branch of the remote Origin repository to local and create a new branch temp
Git pull also pulls the remote branch code, which is equivalent to git fetch + merge, using git fetchbetter understanding, more security, for pull can also update code to local, equivalent to Fetch+merge, many people writing words is not safe.
Copyright NOTICE: This article is the original blogger article, reproduced please retain the source Http://blog.csdn.net/offbye
Git gets the latest version from the remote branch to the local