Git show change files, but I don't change anything git reset doesn't work

I clone the repository into my branch, and when I print the git status, I see the change files, I try to do git reset --hard, but the effect was not: ((

git status On branch release Changes not staged for commit: modified: htdocs/fonts/OfficinaSansBoldC.eot modified: htdocs/fonts/OfficinaSansBoldC.svg modified: htdocs/fonts/OfficinaSansBoldC.ttf modified: htdocs/fonts/OfficinaSansBoldC.woff modified: htdocs/fonts/OfficinaSansC-Book.eot modified: htdocs/fonts/OfficinaSansC-Book.svg modified: htdocs/fonts/OfficinaSansC-Book.ttf modified: htdocs/fonts/OfficinaSansC-Book.woff no changes added to commit git reset --hard origin/release git status On branch release Changes not staged for commit modified: htdocs/fonts/officinasansboldc.eot modified: htdocs/fonts/officinasansboldc.svg modified: htdocs/fonts/officinasansboldc.ttf modified: htdocs/fonts/officinasansboldc.woff modified: htdocs/fonts/officinasansc-book.eot modified: htdocs/fonts/officinasansc-book.svg modified: htdocs/fonts/officinasansc-book.ttf modified: htdocs/fonts/officinasansc-book.woff no changes added to commit 
+5
source share
2 answers

The problem with having input core.autocrlf is that it can change eol characters (end of line) even for (binary) documents that should not be touched.

Try:

 git config --global core.autocrlf false git clone /url/your/repo 

(this means that it will clone your repo again and see if all the differences exist)


With git 2.8 (March 2016), you can quickly check if these changes are related to eol.

See commit a7630bd (January 16, 2016) Torsten BΓΆgershausen ( tboegi ) .
(merger of Junio ​​C Hamano - gitster - on commit 05f1539 , February 03, 2016

ls-files : add eol diagnostics

When working in a cross-platform environment, the user may want to check if the text files normalized in the repository are .gitattributes and if .gitattributes set accordingly.

Let git show the line endings in the index and in the working tree and in the valid text / eol attributes.

The end of the line (" eolinfo ") is shown as follows:

 "-text" binary (or with bare CR) file "none" text file without any EOL "lf" text file with LF "crlf" text file with CRLF "mixed" text file with mixed line endings. 

The effective text / eol attribute is one of the following:

 "", "-text", "text", "text=auto", "text eol=lf", "text eol=crlf" 

git ls-files --eol gives this output:

 i/none w/none attr/text=auto t/t5100/empty i/-text w/-text attr/-text t/test-binary-2.png i/lf w/lf attr/text eol=lf t/t5100/rfc2047-info-0007 i/lf w/crlf attr/text eol=crlf doit.bat i/mixed w/mixed attr/ locale/XX.po 

to show which conditional convention is used in the data in the index (' i '), and in the working tree (' w '), and which attribute is valid, for each path that is shown .

+2
source

I also met the same problem. When I run the git diff , the result is:

 Binary files a/app/webroot/font-awesome-4.4.0/fonts/fontawesome-webfont.ttf and b/app/webroot/font-awesome-4.4.0/fonts/fontawesome-webfont.ttf differ warning: CRLF will be replaced by LF in app/webroot/font-awesome-4.4.0/fonts/fontawesome-webfont.ttf. The file will have its original line endings in your working directory. 

I tried git reset --hard . but that didn't work. But when *.ttf binary added to the .gitattributes file, the reset command worked.

Cheer.

+1
source

Source: https://habr.com/ru/post/1209574/


All Articles