Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On my Win7 Pro 64-bit machine I have TortoiseGit and cygwin with git. If I try to find the pending changes I do get different results from cygwin and TortoiseGit. I'm sure the result of cygwin git is wrong.

Why does git on cygwin report all this files as changed even if I did not touch them?

Output of TortoiseGit (correct): TortoiseGit Output

Output of cygwin git (wrong):

$git status
# On branch master
# 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:   .classpath
#   modified:   .gitignore
#   modified:   belipro.xml
#   modified:   etc/buildnum.properties
#   modified:   etc/db/adjust.sql
#   modified:   etc/db/update11.sql
#   modified:   etc/db/update12.sql
#   modified:   etc/excel-template/Anlagen.xls
#   modified:   etc/projektierbareTemplaes/templateA.rtf
#   modified:   etc/test/belipro.sql.zip
#   modified:   lib/commons-lang-2.6.jar
#   modified:   lib/jacob-1.14.3-x86.dll
#   modified:   lib/jacob.jar
#   modified:   res/ch/pp/belimed/bo/planung/ArbeitsStundenResourcePack.java
#   modified:   res/ch/pp/belimed/bo/planung/AufgabeAuftragResourcePack.java
#   modified:   res/ch/pp/belimed/bo/planung/AufgabeResourcePack.java
#   modified:   res/ch/pp/belimed/bo/planung/arbeitsstunden 32x32.png
#   modified:   res/ch/pp/belimed/bo/planung/arbeitsstunden 64x64.png
#   modified:   res/ch/pp/belimed/bo/planung/aufgabe 32x32.png
#   modified:   res/ch/pp/belimed/bo/planung/aufgabe 64x64.png
#   modified:   res/ch/pp/belimed/bo/planung/aufgabeauftrag 32x32.png
#   modified:   res/ch/pp/belimed/bo/planung/aufgabeauftrag 64x64.png
#   modified:   res/ch/pp/belimed/bo/projekt/DruckbehaelterResourcePack.java
#   modified:   res/ch/pp/belimed/bo/projekt/EldResourcePack.java
#   modified:   res/ch/pp/belimed/bo/projekt/WtdResourcePack.java
#   modified:   res/ch/pp/belimed/bo/projekt/druckbehaelter 32x32.png
#   modified:   res/ch/pp/belimed/bo/projekt/druckbehaelter 64x64.png
#   modified:   res/ch/pp/belimed/bo/projekt/eld 32x32.png
#   modified:   res/ch/pp/belimed/bo/projekt/eld 64x64.png
#   modified:   res/ch/pp/belimed/bo/projekt/projektierbar 32x32.png
#   modified:   res/ch/pp/belimed/bo/projekt/projektierbar 64x64.png
#   modified:   res/ch/pp/belimed/bo/projekt/wtd 32x32.png
#   modified:   res/ch/pp/belimed/bo/projekt/wtd 64x64.png
#   modified:   res/ch/pp/belimed/bo/util/BatchResourcePack.java
#   modified:   res/ch/pp/belimed/bo/util/TypResourcePack.java
#   modified:   res/ch/pp/belimed/explorer/BeliproExplorerComponentFactoryResourcePack.java
#   modified:   res/logging.properties
#   modified:   src/ch/pp/belimed/bo/planung/Aufgabe.java
#   modified:   src/ch/pp/belimed/bo/planung/AufgabeAuftrag.java
#   modified:   src/ch/pp/belimed/bo/planung/Auftrag.java
#   modified:   src/ch/pp/belimed/bo/planung/InternerAuftrag.java
#   modified:   src/ch/pp/belimed/bo/planung/Meilenstein.java
#   modified:   src/ch/pp/belimed/bo/planung/MeilensteinTyp.java
#   modified:   src/ch/pp/belimed/bo/planung/MitarbeiterAuftrag.java
#   modified:   src/ch/pp/belimed/bo/planung/Planung.java
#   modified:   src/ch/pp/belimed/bo/planung/Sammelauftrag.java
#   modified:   src/ch/pp/belimed/bo/projekt/ProjektStatus.java
#   modified:   src/ch/pp/belimed/bo/util/Batch.java
#   modified:   src/ch/pp/belimed/bo/util/Bezeichnung.java
#   modified:   src/ch/pp/belimed/explorer/BeliproExplorerComponentFactory.java
#   modified:   src/ch/pp/belimed/ui/planung/AufgabeSearchPanel.java
#   modified:   src/ch/pp/belimed/ui/planung/InternerAuftragDetailPanel.java
#   modified:   src/ch/pp/belimed/ui/planung/MitarbeiterAuftragDetailPanel.java
#   modified:   src/ch/pp/belimed/ui/planung/MitarbeiterDetailPanel.java
#   modified:   src/ch/pp/belimed/ui/projekt/AnlageSearchPanel.java
#   modified:   src/ch/pp/belimed/ui/projekt/KundeSearchPanel.java
#   modified:   src/ch/pp/belimed/ui/projekt/PlanungAssigner.java
#   modified:   src/ch/pp/belimed/ui/util/BatchDetailPanel.java
#   modified:   src/ch/pp/belimed/util/DbVersion.java
#   modified:   src/ch/pp/belimed/util/ReleaseInfo.java
#   modified:   src/ch/pp/util/DateUtils.java
#   modified:   test/ch/pp/belimed/bo/planung/AufgabeTest.java
#
no changes added to commit (use "git add" and/or "git commit -a")
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

I'd suspect line endings. If Tortoise git works like other native Windows version control clients, it automatically adds carriage returns to checked-out files, and knows to remove them again when comparing against files in the repository. Cygwin git, being a good Unix citizen, doesn't do anything like that, so it sees those carriage returns that Tortoise added as modifications.

Moral of the story: for any particular checkout, stick to either Tortoise git or Cygwin git, otherwise you'll end up with an awful mix of line endings. Another reason not to mix clients is that they might have differences in how they store stuff in the .git directory.

(Much the same advice applies to other version control systems.)

share|improve this answer
    
I'm pretty sure, that this is not the problem. If this would be true, than all files would be marked as changed. But it's only a small subset of ~2000 files. –  BetaRide Apr 22 '11 at 11:10
    
Fair enough, but it would have been helpful to mention that fact in the question. This still leaves the possibility of incompatibilities in the .git format. What differences does Cygwin git actually think there are though, i.e. what does the output of git diff look like? –  ak2 Apr 22 '11 at 11:30
    
@BetaRide, depending on what line endings that set of files were checked in with and the local setting of autocrlf, it could still be possible to have erroneous whitespace changes show up as ak2 suggests. However as you have binary files in this mix, this is probably not the problem. –  RJFalconer Apr 23 '11 at 7:27
add comment

I initially thought whitespace, but you have some .pngs in there too.

Perhaps it's file mode changes. Try;

git config core.filemode false

If that doesn't work and if the only difference is the change timestamp, you could try;

git config core.trustctime false

(Of course you can undo either of these by repeating the command changing false to true)

share|improve this answer
1  
Setting core.filemode to false worked for me. I was having problems with cygwin incorrectly reporting modified files that cygwin itself cloned, fwiw. –  crewbum Jul 13 '11 at 16:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.