I\'ve got a website that has a git repo. I cloned the repo so that I could develop in one directory and then push to the repo, and then pull in the live/prod directory (woul
That usually means the line endings are different. Most diffin programs allow you to ignore differences in line endings. Does yours allow you to do so?
Not the solution, will help this to you.
git diff --no-ext-diff --ignore-space-change -- <path>
-> You can view only the code changes in git bash.
This seems like a whitespace issue, in order to avoid them in the future, you can setup Git to normalize them.
Windows and UNIX system don't use same line-ending, to prevent conflict from happening based on these, you should setup you git config this way:
git config --global core.autocrlf true
git config --global core.autocrlf input
Next, to make sure we only commit with ideal whitespace rules, you can set this config option:
git config --global core.whitespace trailing-space,space-before-tab,indent-with-non-tab
Most likely it's line termination. Try git diff --ignore-space-at-eol
. And for plain (not git
) diff it's diff -b
.