3

I'm looking to refactor the whitespace / identation mayhem in our project. For that I was using the untabify function in MSVS, which does just what I need. The problem is commiting it using Git, since it shows almost every line last edited by me, which is technically correct, but in this case not the desired behaviour.

Are there any ways to do a kind of anonymous, ghost commit or tell Git to ignore whitespace changes?

DenverCoder21
  • 879
  • 3
  • 16
  • 34
  • 2
    possible duplicate of [Git commit that doesn't override original authors in git blame](http://stackoverflow.com/questions/3945382/git-commit-that-doesnt-override-original-authors-in-git-blame) – Chris Maes Jan 02 '15 at 10:59
  • 2
    BTW, the accepted answer to that other question overwrites history, so isn't what you want. The currently top-voted one, by CodesInChaos, seems more appropriate for you. –  Jan 02 '15 at 11:01
  • Thanks for the quick response, guys. This looks very nice, but in my case doesn't resolve the problem, because we're using tools like Atlassian Fisheye and this doesn't seem to cover the whole range of options git blame offers. – DenverCoder21 Jan 02 '15 at 11:18
  • 4
    @DenverCoder21 In that case, it's fundamentally impossible, sorry. If you don't rewrite history, you have a previous commit with bad whitespace, and newer commit with good whitespace, so any tool that compares the two can tell them apart. The only ways around that are 1) rewriting history so that you don't have the previous commit with bad whitespace any longer, 2) changing the tool to not treat differences in whitespace as significant, or 3) forgetting about this altogether and leaving the whitespace as it is. –  Jan 02 '15 at 11:35

0 Answers0