I checked the branch fooand now I want to switch to the branch bar.
error: Your local changes to the following files would be overwritten by checkout:
<300 files follow>
Someone has a file .gitattributeson foothat includes
text=auto
All "changes" are new line changes.
I can delete 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 just read the repo. I do not want to change anything except the working tree. But I can not.
source
share