I have committed some code with some format but the origin has some other format. The reviewer is asking me to revert all my changes and I am searching for some UI tool or some way in Git to remove formatting and give the actual result.
Is there any way to compare two files in Git without their formatting changes?
4.5k views Asked by pramod bhargava At
3
There are 3 answers
0
On
If you use intellij
, consider using the version control
tool provided by it.
The below link details on how to get a diff between two branches. https://stackoverflow.com/a/49642681/2960555
for a single file diff, You can right click on file -> git -> compare.
A new window will gets opened. select ignore options in that.
I think you might have a look at git diff, in particular the two following options:
So running
git diff --ignore-all-space
However, if what you define by formatting is not just whitespace, I guess you have to do it by hand