2

I cloned a repo, then immediately ran git status

I am expecting my working directory to be clean instead I have changes not staged for commit.

Running git reset --hard does not clean my working directory

I ran git checkout pe_oim_admin_2/runtime/prod/he1alxvpmid304/setcp_oim.sh. I noticed the path changed for the file when running git status: pe_oim_admin_2/runtime/Prod/he1alxvpmid304/setcp_oim.sh. The Prod folder has an upper case now.

My git version is 1.9.5.msysgit.0. I updated to 2.9.0.windows.1 and am running into the same problem.

Any idea why git is behaving this way?

I've tried running git clone with core.autocrlf set to true and false. I am getting the same behavior in both situations.

These two lines are in my .gitattributes file:

* text=auto
*.sh text
  • 1
    Might be a problem with Windows being case insensitive and all OSes being case sensitive. – Hermann Döppes Jan 23 '17 at 23:48
  • have you tried to git clone it in a directory you haven't done it before in? – kgui Jan 24 '17 at 00:12
  • I tried it on my colleague's machine in a different directory. Still had changes not staged for commit after running git status. – Programmer703 Jan 24 '17 at 00:18
  • It's due to your 'autocrlf' setting (old and bad way to handle end of lines) . Solve it using '.gitattributes'. Nothing related but you should really update your git to the last version (1.9.5 had some bugs and new versions have some windows specific enhancements!) – Philippe Jan 24 '17 at 00:33
  • Why 2.9.0? Why not the very latest 2.11? – VonC Jan 24 '17 at 15:07
  • My company network blocks s3. That was the latest version they have available for download. – Programmer703 Jan 24 '17 at 15:08

1 Answers1

0

First, on Windows, you can uncompress and use the latest Git for Windows: PortableGit-2.11.0.3-64-bit.7z.exe (auto-extractible exe)

Second, make sure to type (in any folder you want):

git config --global core.autocrlf false
git config --global core.ignorecase true

Then clone again, and see if you still have changes in your git status.
See:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250