git pull --help says:
In its default mode,
git pullis shorthand forgit fetchfollowed bygit merge FETCH_HEAD.
What is this FETCH_HEAD and what is actually merged during git pull?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
FETCH_HEADis a short-lived ref, to keep track of what has just been fetched from the remote repository.git pullfirst invokesgit fetch, in normal cases fetching a branch from the remote;FETCH_HEADpoints to the tip of this branch (it stores the SHA1 of the commit, just as branches do).git pullthen invokesgit merge, mergingFETCH_HEADinto the current branch.The result is exactly what you’d expect: the commit at the tip of the appropriate remote branch is merged into the commit at the tip of your current branch.
This is a bit like doing
git fetchwithout arguments (orgit remote update), updating all your remote branches, then runninggit merge origin/<branch>, but usingFETCH_HEADinternally instead to refer to whatever single ref was fetched, instead of needing to name things.