I checked out a branch foo
, and now I want to switch to branch bar
.
error: Your local changes to the following files would be overwritten by checkout:
<300 files follow>
Someone has a .gitattributes
file on foo
that includes
text=auto
All of the "changes" are newline changes.
I could remove the file, switch branches, and then add it back.
rm .gitattributes
git checkout bar
git checkout .gitattributes
Is this the best (fastest/least typing) way?
EDIT: To be clear, I just want to switch branches. I'm only reading the repo. I don't want to change anything other than the working tree. But I can't.