Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kedramon/9ef8515165b2dce0c3f794238915a989 to your computer and use it in GitHub Desktop.
Save kedramon/9ef8515165b2dce0c3f794238915a989 to your computer and use it in GitHub Desktop.

###Problem File contained CRLF line endings, they was replaced with LF but now file is marked as changed: git status

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:   assets/social/twitter.svg

Trying to checkout doesn't help also trying to turn core.autocrlf to false doesn't help. Something forcing git to see line-endings as change. Answer is inside .gitattributes

*.sql     text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.svg     text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.theme   text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.twig    text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2

File disappeared from changed list after commenting out line with *.svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment