This problem is driving me mad. Using Git with Github.
I'm working on one particular file using spaces instead of tabs. I always ensure that I change all tab indents to spaces. Diffs confirm that I've changed tabs to spaces. I commit and push the code (with other changes) and all is good.
Until, I git pull --rebase
. Now, my file -- in parts -- has tabs replacing spaces! Note, this is on parts of the file that only I have ever edited and I always use spaces, not tabs.
It doesn't happen when I do a normal git pull
, only on rebase.
Additionally, changes on other branches that are merged into the main integration branch are also OK. It's just happens on rebase of the integration branch.
git apply --whitespace=fix
appears to make that happen during rebase.
Maybe set
[apply]
whitespace = warn
in your gitconfig and see if it resolves your issue.
See also the "core.whitespace" setting for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With