Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you ignore whitespace when using git whatchanged -p?

Tags:

git

I can use

git whatchanged -p

to show a log of all the changes I've made to a repository with diffs inline.

I can use

git diff -b

or

git diff -w

to show a single diff that ignores various amounts of whitespace changes.

How can I pass that option to whatchanged in order to print out a list of changes I've made to my repository with inline diffs which ignores whitespace changes?

like image 895
Justin T Conroy Avatar asked Mar 16 '12 17:03

Justin T Conroy


People also ask

How do I ignore a space in git?

Examine carefully the output of git diff , and use the -w flag to ignore spaces. There's also options to show differences within a line. See Diffs within a line below. Note that you won't be able to tell git to skip the space changes when committing.

How do I ignore whitespace changes in Github?

On github, you simply append the w=1 parameter to the URL for it to ignore whitespace.

How do I get rid of file differs only in whitespace?

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!


1 Answers

What about using git log -p -w? I believe that is the same output as whatchanged -p.

like image 88
brianz Avatar answered Nov 10 '22 01:11

brianz