What is the FETCH_HEAD file in a Git repository?

Git Hard

Git — Hard

What is the FETCH_HEAD file in a Git repository?

Key points

  • FETCH_HEAD is updated by git fetch, not git pull
  • It records the SHA of each fetched branch tip, not the URL of the remote
  • The file is used by git pull to determine the merge commit
  • FETCH_HEAD is a temporary reference file, not a lock file

Ready to go further?

Related questions