Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Git GUI to Ignore Space Changes in its diff View

Git comes with two default UI tools (on Windows at least): Git GUI and Gitk.

When browsing a commit, Gitk has a checkbox called "Ignore space changes" that makes the diff show only non-space related changes.

However, Git GUI always shows the full diff, and there is no equivalent checkbox.

Is there a way for getting Git GUI to ignore space changes too?

like image 456
Adi Shavit Avatar asked Apr 06 '14 06:04

Adi Shavit


People also ask

How to ignore whitespace in git diff?

Considered using git diff -b instead? "-b --ignore-space-change Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent."

How to remove whitespace changes in git?

Right click on base branch in the Git tab, and do reset. It will undo the commit and stage non-whitespaces changes for commit. Now commit and push -f (I always force push via command line). That's it, you are done!

How to not commit whitespace changes?

You can hide whitespace changes for GitHub diffs in two ways. First, click the gear icon near the top of the page and check the “Hide whitespace changes” option.


1 Answers

Answering myself...

In the Git GUI main menu go to Edit -> Options. In Additional Diff Parameters put -w (or --ignore-all-space).

In fact, any other git-diff parameter can go there too.

like image 154
Adi Shavit Avatar answered Sep 26 '22 22:09

Adi Shavit