Why does “git pull” get all branches from repository but “git pull origin master” doesn't?

Why does git pull get all branches from repository but git pull origin master doesn’t? I discovered it the hard way. Is it the only functional difference between these two commands?

Explanation like this tells me nothing:

  • Is it possible to git grep for tabs?
  • Correct merged file in git
  • git push showing “Everything up-to-date” but compare shows differences
  • git blame of particular lines inside all files filtered with grep command
  • Can't start a GIT build on Teamcity
  • Complex interactive rebase in one step?
  • git pull = git fetch origin + git merge origin/master

    git pull origin master = git fetch origin master + git merge FETCH_HEAD

  • MVN package install error javac: invalid target release: 1.8
  • How can I work in my repo using Git, and push to a Mercurial repo?
  • How to checkout svn+ssh repository with subgit?
  • Is it possible to check in with a different account than the account creating the clearcase view
  • Using Go CD with .NET
  • why not deploy code directly from git or bzr repository?
  • 2 Solutions collect form web for “Why does “git pull” get all branches from repository but “git pull origin master” doesn't?”

    The latter command, git pull origin master, tells git to fetch and merge specifically the master branch (from the remote named origin, to be even more precise).

    git pull fetches updates for all local branches, which track remote branches, and then merges the current branch.

    From the documentation of git pull:

    git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch

    When you call git fetch without arguments, the following happens

    Fetches named heads or tags from one or more other repositories, along with the objects necessary to complete them.
    git fetch [fetches] from (…) a single named repository (…)

    When you add arguments, only the specified remote and head (=branch/tag/commit/…) are fetched, and then merged.

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