Wednesday, November 05, 2014

Git line ending fixups revisited

I blogged about this a few years ago. I discovered how to do this when using .gitattributes, which is automatically created when you use Visual Studio to create a project that uses git as its version control system.

I have a .gitattributes file that contains (among other things) this line at the top:
The sequence of commands is the following:

First, add all changed files: Then, edit the .gitattributes file to comment out the "text=auto" line and save this file: Then issue this command to un-stage all the files. It doesn't matter whether some of the files have meaningful changes. You're not resetting or undoing any file edits, you're merely removing them from the index: Finally, restore the "text=auto" line in your .gitattributes file and save that file: You should be all set. If you issue a git status command again you should see only the files that have meaningful changes, if any.