I use git for version control. One of the biggest conveniences for me is running “git pull” to download the latest commits. But sometimes, the git pull fails because of a file that changed on the server. That’s usually my fault.

So here’s how to go about pulling from git anyways:

From the directory you are trying to “git pull”

  • Your shell will read “Fetching origin”

Then execute the git reset command:

  • You will see something similar to this output:

HEAD is now at 76637bf fix truncate issue


You can confirm that you’ve been reset by running a git pull:

Here was my exact shell session (with a few git pull errors redacted)


If you want to pull a different branch other than master, you need to define that.