Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github windows, whole file shows change after commit.

Tags:

git

windows

I am using the github windows app. I seem to be having problems with it showing what has changed and what hasn't. Before I commit it correctly shows only the changed lines, but after I commit, it shows that all the lines have changed in the file. Any way to get it to stop this?

It is quite annoying and any help would be appreciated. ps, i made sure that their are no line ending issues.

like image 477
TofuNinja Avatar asked Apr 17 '13 23:04

TofuNinja


People also ask

Why git diff shows whole file changed?

These changes mean that metadata about your file changed, however the content of your file did not. If you're working in a group, this may start to intefere with pushes or just add noise to your commits.

How can I see the difference after a commit?

To see the diff for a particular COMMIT hash, where COMMIT is the hash of the commit: git diff COMMIT~ COMMIT will show you the difference between that COMMIT 's ancestor and the COMMIT . See the man pages for git diff for details about the command and gitrevisions about the ~ notation and its friends.

What is a .gitattributes file?

DESCRIPTION. A gitattributes file is a simple text file that gives attributes to pathnames. Each line in gitattributes file is of form: pattern attr1 attr2 ... That is, a pattern followed by an attributes list, separated by whitespaces.


1 Answers

This is usual core.autocrlf issue (different setting in your clients and definitely wrong in Github client) - read "Formatting and Whitespace" topic and core.autocrlf part of it carefully

PS: you can test my statement using differ, which can ignore EOL-difference in compared files

like image 145
Lazy Badger Avatar answered Oct 10 '22 15:10

Lazy Badger