The problem with comparing Git branches
The traditional workflow is a time sink - and it clobbers your working directory in the process.
The old way
- Stash or commit your current changes
- Note the current branch name
git checkout branch-a- Export or note what you want to compare
git checkout branch-b- Do your comparison
git checkout original-branch- Pop the stash and hope nothing breaks
Every step is a context switch. Every checkout is a risk if you have uncommitted changes.
With DirectoryCompare Pro
- Add your repository as a source, pick a branch
- Add the same repo again, pick the other branch
- Click Compare
Your working tree is never touched. You can compare any two branches - or any branch against your live working directory - without stashing a single file.
How to diff Git branches in DirectoryCompare Pro
The workflow is four steps. You can have your comparison open in under a minute.
Add your repo as a source
Click "Add Source" and choose Git Repository. Point it at any local .git directory on your machine.
Pick the first branch
Select the branch or commit ref you want as the left side of the comparison. Tags and commit SHAs also work.
Add the second source
Add a second source - it can be the same repo on a different branch, a different local clone, a live folder, a ZIP archive, or a GitHub repository.
Click Compare
DirectoryCompare Pro reads both trees, builds the diff, and presents a full folder comparison with file-level status and per-file diff viewing.
Mix Git branches with live directories
One of the most useful workflows is comparing a Git branch directly against your current working directory.
Add feature/new-ui as one source and your live src/ folder as the other.
You can see immediately what your uncommitted changes add or remove compared to any branch - without
running a single Git command.
What you can compare
Git sources in DirectoryCompare Pro are not limited to two local branches.
Two branches, same repo
Add the same repository twice with different branch selectors. Works with local branches, remote-tracking branches, and any commit SHA.
GitHub repositories
Add a GitHub repository directly via the REST API. No cloning required. Compare branches or commits from any public or private repo you have access to.
Branch vs. live folder
Pair a Git branch source with a local folder, archive, or FTP path. The mixed-source capability means you can compare any committed state against any live state.
Multiple branches at once
With N-way comparison you can load main, develop, and feature/xyz all at once and see where each branch diverges.
Branch vs. release archive
Compare a Git branch against a ZIP, TAR, 7Z, RAR, or ISO archive. Useful for verifying that a release build matches the tagged source.
Any commit SHA or tag
Not limited to branch tips. Enter any commit hash or tag name to compare a historical state against the current branch, another commit, or a live directory.
Ready to compare Git branches without the checkout dance?
Free 7-day trial, starts automatically on first launch. No sign-up required.
Download DirectoryCompare ProFrequently asked questions
Can I compare two branches in the same repository?
Yes. Add the repository path twice as two separate sources, then select a different branch for each. DirectoryCompare Pro treats each source independently, so the same repo path can appear multiple times with different branch selectors.
Does it work with GitHub repositories?
Yes. DirectoryCompare Pro can connect to GitHub via the REST API and compare branches or commits without cloning the repository locally. You provide a personal access token for private repos; public repos need no credentials.
Do I need Git installed on my machine?
No. DirectoryCompare Pro uses its own bundled libgit2 library to read Git repositories. The system-level git command is not required.
Does it modify my working tree or stash anything?
No. Reading branches through libgit2 is a read-only operation against the object database. Your working directory, index, and stash are completely untouched.
Is it free?
Git branch and GitHub comparison requires the Standard tier ($39/year). DirectoryCompare Pro includes a full 7-day trial that starts automatically on first launch - no sign-up needed. The Basic tier is free forever and covers 2-way local folder comparison.
Does it run on Linux?
Yes. DirectoryCompare Pro supports Linux x86_64. The Git integration via libgit2 works the same on Linux as on Windows.
Can I compare more than two branches at once?
Yes, with N-way comparison (Standard tier and above). You can add three or more Git branch sources simultaneously and see a consolidated diff view showing where all branches agree and where they diverge.
Use DirectoryCompare Pro as your Git mergetool
Register DCP as Git's merge conflict resolver. When you run git mergetool, Git opens DCP automatically with base, local, and remote versions pre-loaded. Resolve conflicts, save, done. Free in Basic tier — no paid license required.
Step 1 — Add to your .gitconfig
[mergetool "dcp"]
cmd = "C:/path/to/DirectoryComparePro.exe" -m "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = true
[merge]
tool = dcp
Replace C:/path/to/ with the folder you extracted DCP into. Use forward slashes even on Windows.
Step 2 — Trigger it during a merge conflict
git merge feature/my-branch
# conflict!
git mergetool
Git calls DCP once per conflicted file. Resolve all hunks, click Save, close the window. Git marks the conflict resolved automatically.
No license needed
3-way merge (base/mine/yours) is included in the free Basic tier. No registration, no trial expiry.
trustExitCode = true
DCP exits 0 when all conflicts are resolved and saved, 1 when you cancel. Git uses this to know whether to mark the file as resolved.
Just unzip and point Git at it
DCP is a single portable exe. Drop it anywhere, update .gitconfig with the path, and you're done.