If Tortoise and git disagree on the commit status ...

2014-08-15 | #git, #solution

TortoiseGit is a windows software, while git runs cross platform. Tortoise of course uses git internally, but remains windows-centric at heart. If Tortoise now deems a rep clean, while command line git thinks of it as changed, then you're most probably on two systems having an essential difference:

Line endings.

Tortoise treats CRLF and LF as equivalent while command line git sees this as changed. To avoid this it's highly recommendable to just use LF everywhere. Any text editor has a default setting for this. Use it and set it to unix-style everywhere.

If you use one of the good editors, changing the endings is trivial, even in windows. In all other cases, just use sublime or notepad++.

Note: Tortoise cannot commit a file if the only change in the commit is a change of line ending style. You have to include at least one content change somewhere in the commit, otherwise Tortoise will fail on commit telling you "the working directory is clean".