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.

  • git repository to staging site to live site
  • Git squash commits of renamed files (an keep history)
  • git error - failed to push some refs (pack-objects died with strange error)
  • Serving directory from webserver if its also GIT repo
  • Git HTTPS Authentication fails interactively, but works in the URL
  • Git archive broken after moving from ext3 to FAT and back to ext3
  • I don’t want to commit everything every time I switch to the other OS to work. Is there a solution?

  • Deleted branch in Gerrit and it is still there, in its Git repo
  • How to make git log cut long comments?
  • Easy merging in svn using git-svn
  • git turn off “LF will be replaced by CRLF” warning
  • Do I have to give Git patch a reasonable name?
  • Submitting a pull request with a Visual Studio ?
  • 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.