Q:

git - dual boot ubuntu and windows with separate data partition

I just installed ubuntu along side windows 7. All of my git local working folders are on a separate data partition.
Everything is committed in windows 7's git, but in ubuntu's git, running git status shows everything as modified. When I tried git log all the history is still there.
I don't want to commit everything every time I switch to the other OS to work. Is there a solution?

A:

Your problem is that when you check out files on Windows with the git default config, they are created with CRLF (the windows default) line endings in your working directory, but committed as LF for cross-platform compatibility.
Now your Linux sees the CRLF on every line and says that it’s different to the LF in the repo. That’s why every line is reported as different.
I would suggest setting the line endings to LF on windows. In a previous answer I explained the details of how to do that. Following those steps will also enable line-ending normalization to LF on linux, which will avoid problems if you accidentally create some CRLF on windows and commit that in linux later on. 
You can also just disable line ending normalization completely, but that is likely to cause trouble in the future, unless you only use a completely fixed set of editors, whose line ending handling you know very will.

