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 to automatically run another application affter pull on repository?
  • Gitlab: The resource you were looking for doesn't exist - How to undo a pull
  • How to have git setup tracking branch on pull
  • error: git checkout-index: unable to create file (Permission denied)
  • Pull only latest commits to shallow clone
  • Git pull into wrong branch
  • how to resolve git pull conflicts in xcode ui
  • How to sync a subdirectory of a git 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

    So, basically 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 then master would be updated.

    If you don’t want your branches to be updated, just use git fetch instead.

    Git Baby is a git and github fan, let's start git clone.