Netbeans 7 + Git plugin on Windows Issues?
Published Thu, 26 May 2011 • 6 comments
I just started checking out Netbeans 7 which has a nice Git plugin available now in the plugin manager.
I was horrified though when I opened a project to find every single source file was being shown as "modified" by Netbeans, although there were no diffs shown inside the files!
However, it turns out that it's not Netbean's fault.
If you're using msysgit on Windows to check out your projects, you probably installed it and did the typical "next->next->next" through the installer. Including through the following screen....
Well by default msysgit does line ending mutation so that if you checkout a source file to a Windows box, it will add Windows line ending ("\n\r") to all source files, and when you push it back to the server, change the line ending to Unix style ("\n"). Unfortunately this causes Netbean's Git plugin to (rightly) say, "Hey! You changed all these files!".
Really the auto line ending change stuff is a really bad idea, and you should disable it.
The command to do so is as follows -
git config --global core.autocrlf false
After disabling, the Git support seems to work really well.
About the Author
Richard Nichols is an Australian software engineer with a passion for making things.
You might also enjoy reading -
- Maven Junit test integration broken in Netbeans 7.2?
- Getting nice font rendering in Netbeans 7 on Ubuntu 12.04
- Use Hudson (now Jenkins) to restart a Windows service...
- MHTML Browser Compatibility - CSS Inlining
- Useful shell scripts: nightly postgresql backup