Search code examples
gitubuntugedit

Git false positives after Ubuntu upgrade


Started a Git repository under Ubuntu 9.10. Finally upgraded to 10.04. Current Git is 1.7.0.4.

Now when I edit a file (with gedit) that was last changed before the upgrade, then commit, the commit is full of false-positive changes, ~400 lines out of ~1400.

I use spaces to indent within my source, if that matters.

Edit: a false-positive change looks like

- var a = 1;
+ var a = 1;

Edit: problem is CR/LF changed to LF, so question becomes how to suppress these on commit? (And maybe that's not advisable?)


Solution

  • Check the GitHub help on the subject.

    In your case, that would be setting this config value:

    $ git config --global core.autocrlf input
    

    This will convert everything to LF when committing. It may cause problems if your repository is expected to be in CR/LF.

    If you're using Gedit, this plugin would be nice to have in your case.