0

In trying to perform a git pull or git fetch / merge, I am getting the message

error: Your local changes to the following files would be overwritten by merge: 
/path/to/file.txt 

Please, commit your changes or stash them before you can merge. 

There are several strange things about this: 1) I have not (intentionally) made any changes to the file in question. git diff shows

warning: LF will be replaced by CRLF in /path/to/file.txt. 
The file will have its original line endings in your working directory. 

I'm guessing that happened automatically, but I'm surprised git is treating it as a show-stopper.

2) stashing this "change" still won't let me merge. I can see that the stash was created, and have tried dropping/restashing, and I still get the error.

3) per this so question/answer, I have tried forcing a merge (with the commands git checkout HEAD^ /path/to/file.txt and then git pull). Same error.

I suppose I can brute force it by deleting the repository in its entirety and cloning it fresh, but I'd like to understand what's going on. In the past, stashing changes always resolved this problem.

This seems tangential, but just to offer all info, I recently upgraded from git bash 1.9.4 to 1.9.5 (Windows) and upgraded my openssl version.

Community
  • 1
  • 1
Gojira
  • 2,941
  • 2
  • 21
  • 30

1 Answers1

0

It turns out another process had a lock on that file. Once I killed the process, the merge went ahead as expected with no issues.

Gojira
  • 2,941
  • 2
  • 21
  • 30