Practical Git via GitExtensions
  • Git - a Distributed System
  • Bare Minimal Configurations
  • Creating a New Branch
  • Making a Commit
    • Adding only a portion of a file
    • Commit Message
    • Cherry-pick
    • Revert
  • Rewriting History
    • Rewording the Last Commit
    • Rewording Commit Message in Middle
    • Editing the Last Commit
    • Squashing Last Few Commits
    • Squashing Commits in Middle
    • Spliting Commit into Multiple
    • Removing a Commit
    • Pushing after Rewriting History
  • Lost and Found
  • Comparing Commits or Branches
  • Checking out a Branch into Another Folder
  • Blaming History
    • Blame
    • Bisect
  • Disabling Auto Tracking Branch
  • Line Ending
  • Ignore Unwanted Files
Powered by GitBook
On this page

Was this helpful?

Comparing Commits or Branches

PreviousLost and FoundNextChecking out a Branch into Another Folder

Last updated 4 years ago

Was this helpful?

If the commits (or head commits of two branches) are close in the graph, we can select one and select another with CTRL key press. Then we can see the diff in the diff view.

If they are far away, we can right click one commit/branch and select the Compare menu

In the branch/commit compare form you can swap the BASE and the HEAD, or compare to merge base, or even select another commit to compare. Unfortunately it doesn't have a files filter right now.

Command line:

git diff <branchA>..<branchb>  # also works for commits
git diff <branchA>...<branchb> # compare to merge base.
# for example
git diff main..origin/main

Merge Base

         o---o---o---o---o---o---o---B
        /
---o---merge base is here---o---o---o---A