I have the following situation: A coworker has committed a bunch of files with Windows line endings. We have a .gitattribute
which removes the Windows line endings during commit
.
That means after pull
, I have dozens of files that are marked as "locally changed" when they weren't. I can't check them out since Git will take the (broken) file out of the repo (where it has Windows line endings), fix the line endings to end up with a file that's always different to what is currently in the repo.
One member of the team has fixed those files and committed and pushed them.
This question answers my question at the price of losing all local commits (i.e. everything that hasn't been pushed, yet): How do I force "git pull" to overwrite local files?
How do I pull without losing my local commits?
This is my Git repo on the server:
A --> B --> BAD1 --> FIX1(HEAD)
BAD1
contains bad commits, FIX1
fixes them.
This is what I currently have on my disk:
A --> B --> BAD1 --> LC1 --> LC2(HEAD)
\---> FIX1
I arrived here by git pull --rebase
. before that command, I had:
A --> B --> LC1 --> LC2(HEAD)
What I want to end up with is:
A --> B --> BAD1 --> FIX1 --> LC1 --> LC2(HEAD)