Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get different results in git bash (msysgit) and git in cygwin?

Tags:

git

cygwin

I alyways used the git bash but now I have to change to cygwin because I need wget and other things, so I thought I could use the builtin git as well since it is newer.

The git bash is version 1.9.4-preview, the one in cygwin is version 2.1.4. I have a cloned repo I worked with using the git bash. I commited and pushed everything and I'm on the develop branch. When I use "git status" I get this:

On branch develop
Your branch is up-to-date with 'origin/develop'.

nothing to commit, working directory clean 

In cygwin I get this part

On branch develop
Your branch is up-to-date with 'origin/develop'.

But then I get a list of hundreds of files that are not staged for commit. Why do I get different results? I'm in the same directory in the same repo, the results should be the same.

like image 385
Fels Avatar asked Mar 17 '23 22:03

Fels


1 Answers

It’s most likely due to differences between the two Git configurations. Git uses a number of configuration settings to tell it how to behave such as how to treat differences between DOS and Unix-style line endings. These include:

  • core.autocrlf
  • core.ignorecase
  • core.eol

See git config --help for more info on these and other configuration options.

You should run the following commands on both systems and compare the configuration settings:

  • git config --system --list
  • git config --global --list

Note that the global settings take precedence over the system settings. The system settings are set for every user on the system (/etc/gitconfig in Cygwin) while the global settings are for only your user account (~/.gitconfig on Cygwin) and apply to all your repositories.

Also: you can also run git config --local --list to see the configuration settings which are local to the repository – but these will be the same on both Cygwin and MSys Git.

like image 95
Anthony Geoghegan Avatar answered Mar 20 '23 07:03

Anthony Geoghegan