Kubuntu/Windows 7 dual-boot and git
I've been using Kubuntu and Windows 7 on my laptop for some time. Re开发者_运维技巧cently I also started using git to keep track of a project I'm working on. At first I thought I'd use the same git repo for editing from both Kubuntu and Windows, but I soon discovered that committing changes on Windows would make git on Kubuntu think all the files have changed since the last commit, although the change doesn't seem to be content related. The exactly same thing happens if I do a commit on Kubuntu and right after that do a git status on Windows.
I know I could use different repos for Kubuntu and Windows and just merge them together when I'm done, but if anyone knows how I could use the same repo I would really appreciate the help.
Could it be line ending or character encoding related? Are you using unix line endings and utf-8 in both editors?
Ok, so it turns out it was a line ending problem. It seems it was related to the core.autocrlf option git has, which if turned on, changes the line ending of files in the repository. I just forgot to turn the option on. If you need details about fixing the problem, this should help you: http://help.github.com/dealing-with-lineendings/ . You could also check the documentation on git-config(1) to see exactly what the core.autocrlf option is all about
精彩评论