views:

273

answers:

2

I've been using Kubuntu and Windows 7 on my laptop for some time. Recently 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 Win, but I soon discovered that committing changes on Win 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 Win.

I know I could use different repos for Kubuntu and Win 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.

+2  A: 

Could it be line ending or character encoding related? Are you using unix line endings and utf-8 in both editors?

lemonad
I'm using emacs both on Win and Kubuntu, and I think I've configured it to use the same line ending (unix) and utf-8 enconding. But I don't think it's related to this, because even files I haven't edited in some time appear as modified. What's even stranger is that not all files appear modified, only some of them. Not really sure what these files have that others don't.
Andu
+1  A: 

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

Andu