git pull will move the local branch to the latest commit?
I have a local branch, which is
topic, this branch is labelled on the latest local commit, for example commit version 3, I stay on
topic branch, not
master branch, then I do the
git pull, there are other two commits(version 4 and version 5) showed up and the
topic is moved to the latest commits, is it right? Should I stay at branch
master and do the git pull? What is the difference?
- How restrict only one pull request at a time in TFS git?
- How to sync a subdirectory of a git repo?
- Does “git fetch --tags” include “git fetch”?
- Gitlab: The resource you were looking for doesn't exist - How to undo a pull
- egit pull with uncommitted changes
- Git pull on remote repo
One Solution collect form web for “git pull will move the local branch to the latest commit?”
As the man pages says:
git-pull – Fetch from and merge with another repository or a local branch
git pull is a shortcut for
git fetch followed by
git merge. That’s why it will move your branch reference to the latest commit. If you were on
master would be updated.
If you don’t want your branches to be updated, just use
git fetch instead.