Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

practical git commands to compare/diff between various branches

Tags:

git

I am still a bit weary of branches and comparing exactly what has changed. I don't like how things are just dumped to the console, especially when file sizes are large and many files have changed.

If I plug in perforces diff, will I get this:

  1. a list of branches, and changes
  2. the ability to diff between branches and all affected files are easily comparable to other branches/versions?
like image 510
mrblah Avatar asked Nov 16 '25 07:11

mrblah


2 Answers

First, git by default uses pager when output is large enough, be it git log (or git log --graph) or git diff.

Second, you can use git difftool to run configured (or autodetected) graphical diff tool.

like image 109
Jakub Narębski Avatar answered Nov 18 '25 21:11

Jakub Narębski


I frequently use

git diff master...HEAD > branchdiff.diff

That compares the head of the current branch against the master, and dumps it in a file I can look over instead of dumping it to the console

like image 33
EMiller Avatar answered Nov 18 '25 19:11

EMiller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!