Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why git is considering the whole file changed while just a part of it is changed

I'm facing a strange situation with git . I just have edited several lines in a long file but then when I went to commit changes ,I saw that git just highlighted the whole file content with a red color . what is wrong ?

I'm using git's windows GUI

Edit : one thing I remember now is that I added .csproj to the gitignore list in last commit . does this has any effect on this ?

Update : the problem as friends suggested was from line ending . I solved it using this question's answer

like image 282
mohsen dorparasti Avatar asked Nov 27 '25 14:11

mohsen dorparasti


1 Answers

The problem was because of line ending .

git config core.autocrlf was set to true . I used solutions mentioned in this 2 posts

Dealing with line endings

Trying to fix line-endings with git filter-branch, but having no luck

and set it as false . and it is solved.

like image 180
mohsen dorparasti Avatar answered Nov 29 '25 11:11

mohsen dorparasti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!