Search code examples
gitintellij-ideacygwinbabun

Babun's git and Windows' git don't work together


I have two gits installed on my computer,

  1. One is used in babun(which is basically cygwin with a bunch of nice addons), the git is installed via pact install
  2. One is used in Command Prompt, it's the official git binary for Windows.

The interesting thing was, the commits made with babun's git didn't reflect on git for Windows. For example, for the same git repository, this is the result of babun's git.

git status                                                                       ~/apps/med-prerate-general
On branch dev
Your branch is ahead of 'origin/dev' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

This is the result of git for Windows

git status
On branch dev
Your branch is ahead of 'origin/dev' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   somefile.iml

no changes added to commit (use "git add" and/or "git commit -a")

What could cause this? I need the result to be consistent because intellij can only work with native git, it couldn't see the changes I made with babun's git.


Solution

  • The problem was that babun didn't process line endings correctly. The following line solved my problem.

    git config --global core.autocrlf input