I was also curious, so I asked an AI, I haven't tried this yet:
To perform a
git diff of a different branch using
UltraCompare, you have two main approaches: using the command line (which "pipes" the difference into UltraCompare) or using the UltraCompare GUI if you have your repository opened.
Method 1: The Command Line (Recommended)
If you have UltraCompare integrated as your
difftool, you can compare your current branch against another branch (e.g., main) with a single command.
- Open your terminal/command prompt.
- Run the following command:
Bash
git difftool <branch_name>
Replace <branch_name> with the branch you want to compare against.
- Result: Git will launch UltraCompare for each file that differs between your current branch and the target branch.
Note: If you want to compare two specific branches (neither of which is your current branch), use:
git difftool branch1..branch2
Method 2: Comparing Specific Folders in the GUI
If you prefer not to use the terminal, you can do this manually by pointing UltraCompare to the different directory states:
- Open UltraCompare.
- Go to Folder Mode: Select 3-Way Folder Compare or 2-Way Folder Compare.
- Path 1: Browse to your active project folder.
- Path 2: Browse to a local clone or a specific git checkout of the other branch.
- Hit Go: UltraCompare will highlight every file that is different. Double-clicking a file will open the File Compare view to show the code changes.
Method 3: Setting UltraCompare as your Default Difftool
If Method 1 didn't work, it's likely because UltraCompare isn't configured in your .gitconfig yet. You can set it up by running these commands:
Bash
git config --global diff.tool uc
git config --global difftool.uc.cmd 'uc.exe "$LOCAL" "$REMOTE"'
(On macOS/Linux, replace uc.exe
with the path to the uc
executable).
Pro Tip: Comparing with a Remote Branch
If you want to see what is different between your local branch and the version on GitHub/GitLab without merging yet, use:
Bash
git fetch origin
git difftool origin/<branch_name>
See if this is what you were looking for.
HTH,
Billy