Question

I am using the GitHub for Windows client, now it seems to state that there are uncommited changes even though the diffs are empty.

I already tried to commit the empty diffs but i still get the same thing over and over again.

I typed git status in the Shell and this is what I got:

C:\Users\Nicholas\Documents\GitHub\Vesper.next [master +0 ~6 -0]> 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:   LICENSE.txt
modified:   README.md
modified:   v.next/css/ext-styleNext.css
modified:   v.next/js/ext-globalVariables.js
modified:   v.next/js/modernizr.js
modified:   v.next/js/numeric.js

no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\Nicholas\Documents\GitHub\Vesper.next [master +0 ~6 -0]>

This is the output of git diff:

C:\Users\Nicholas\Documents\GitHub\Vesper.next [master +0 ~6 -0]> git diff
warning: LF will be replaced by CRLF in LICENSE.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in v.next/css/ext-styleNext.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in v.next/js/ext-globalVariables.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in v.next/js/modernizr.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in v.next/js/numeric.js.
The file will have its original line endings in your working directory.
Was it helpful?

Solution

The reason for this is git's feature to automatically convert between the different line endings, this is usually undesirable as the editor takes care of this anyway.

You can disable the feature using:

git config core.autocrlf false

And reset the changes using:

git reset --hard # This will reset any changes in your working directory, make sure to save the important changes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top