The FETCH_HEAD is a reference to the tip of the last fetch, whether that fetch was initiated directly using the fetch command or as part of a pull. The current value of FETCH_HEAD is stored in the .git
folder in a file named, you guessed it, FETCH_HEAD
.
So if I issue:
git fetch https://github.com/ryanmaxwell/Fragaria
FETCH_HEAD may contain
3cfda7cfdcf9fb78b44d991f8470df56723658d3 https://github.com/ryanmaxwell/Fragaria
If I have the remote repo configured as a remote tracking branch then I can follow my fetch with a merge of the tracking branch. If I don't I can merge the tip of the last fetch directly using FETCH_HEAD.
git merge FETCH_HEAD