Search code examples
eclipsegitegiteclipse-mars

Eclipse Git Configuration System Settings is disabled


I'm working with Eclipse Mars, on Windows 7 64 bits and I recently discovered that when I clone a repository using eclipse built-in git clone feature, CRLF are not added to the files, and they are cloned with only LF at the end.

I checked Eclipse config for Git (Team > Git > Configuration) and I found that System Settings is empty and all buttons disabled and it says "Unknown" in the Location field.

I have Git for Windows 2.5.0 64 bits installed. Apparently now the system gitconfig file should be under C:\Program Files\Git\mingw64\etc but by default there is no file there.

I discovered that if I manually populate it from cmd (git config --system core.autocrlf true) it will be created, but still can't select it from Eclipse.


Solution

  • You need to tell EGit where the default system configuration is for it to be able to pick up the values. There's a Browse button which should allow you to change it according to the help pages:

    https://wiki.eclipse.org/EGit/User_Guide#Pointing_out_the_System_wide_configuration

    You can also set this property in the User Settings which Eclipse will respect. Global is 'for all users of this machine' and User Settings is typically stored in your home directory, i.e. 'for just this user'.

    You'd have to find where the file that's being created by git config --global on your setup is. It's likely that git isn't on the path, and that's why Eclipse can't auto-guess where it should be.

    By the way, unless you really, really need to have CRLF on the files you should prefer to keep them as how they are stored remotely - it will be faster for EGit and Git to perform deltas if it doesn't have to do line-ending conversion on most operations.