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.

  • What is the safest way to correct the date of a future-dated commit in git, and what are the consequences?
  • Why does Git require me to pull before I push?
  • How do I configure IntelliJ 11.0 so that Git commits will not replace the entire file contents?
  • How to see changed lines with certain words and the containing file for a git commit? - Can git diff print a file name line prefix?
  • Making sense of git submodule status output
  • Git amend/reword (without adding/changing files)
  • I don’t want to commit everything every time I switch to the other OS to work. Is there a solution?

  • Convert darcs repos to git with multiple branches
  • Cloning a git repo that has submodules
  • TortoiseGit error: “Remote name must not be empty”
  • Do I have to commit a merge to make git-rerere record my conflict resolution?
  • Git: specifying a git merge strategy “ours” in gitattribute for a whole folder (or just disable merge errors on specific folder?)
  • Delete all files and history from remote Git repo without deleting repo itself
  • 3 Solutions collect form web for “git – dual boot ubuntu and windows with separate data partition”

    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.

    The problem is that the newline convention on Windows differs from Linux, and so on the Ubuntu side every file looks like it’s been modified in its entirety (with the addition of a CR right before the end of each line). This usually happens because the repo is checked out with some level of autocrlf: in the repo, the files have the LF convention, but when checked out on Windows, the files have CRLF line endings.

    If you want to safely share your working copy with Windows and Linux, you should just turn off core.autocrlf.

    I’m guessing there’s an issue with line endings. You probably have commited your code with windows line endings and when you checked out the code in ubuntu git converted those to unix style line endings.

    Take a look at this page Dealing with line endings

    Git Baby is a git and github fan, let's start git clone.