Okay, let's troubleshoot this. git-split-diffs is essentially a wrapper that processes the output of git diff (or git log -p) and then pipes it to diff-so-fancy (or a similar tool) to render the side-by-side view.
Here's a checklist to go through:
Is git-split-diffs installed correctly and in your PATH?
You installed it (presumably via npm install -g git-split-diffs).
Verify it's found:
powershell
Get-Command git-split-diffs
If this doesn't find it, your npm global bin directory isn't in your system's PATH. You can find the npm global bin path with npm prefix -g and add that to your PATH environment variable.
Is diff-so-fancy installed and in your PATH?
git-split-diffsrelies on diff-so-fancy (or a compatible alternative configured) to do the actual side-by-side rendering.
Install it if you haven't: npm install -g diff-so-fancy
Verify it's found:
powershell
Get-Command diff-so-fancy
Test diff-so-fancy directly:
powershell
git diff --color HEAD~1 HEAD | diff-so-fancy
If this command does give you a side-by-side diff, then diff-so-fancy is working, and the issue is likely with how git-split-diffs is calling it or with its own processing. If this doesn't work, then diff-so-fancy is the primary problem.
Pager Issues (Very Common!)
git-split-diffs (and diff-so-fancy) might be trying to use a pager (like less) that isn't configured to display ANSI color codes correctly, or that strips the formatting needed for side-by-side.
Try disabling the pager explicitly for git-split-diffs:
powershell
$env:GIT_SPLIT_DIFFS_DISABLE_PAGER = "1"
git log -p --color -n 2 | git-split-diffs
# To unset it for the current session afterwards if needed:
# Remove-Item Env:GIT_SPLIT_DIFFS_DISABLE_PAGER
Alternatively, pipe the output to cat (or PowerShell's Out-Host which is similar for this purpose) to bypass any implicit pager:
If this works, the pager was the issue. You'll want to configure your Git pager (core.pager) or system PAGER/LESS environment variables correctly. For less, you typically need less -R or less -r.
powershell
git config --global core.pager "less -SR" # Or "less -FRX" which is common
Color Configuration for Git:
Ensure Git is configured to output color. Your --color flag should do this, but it's good to check global settings.
powershell
git config --global color.ui auto # Or 'always'
git config --global color.diff auto
# You might also need to tell diff-so-fancy to always use colors
git config --global color.interactive auto # if you plan to use it for staging
Side-by-side diffs need enough horizontal space. If your terminal window is too narrow, diff-so-fancy might fall back to a more compact format. Try widening your Windows Terminal window.
git-split-diffs has a --width option. You can try setting it explicitly:
This helps isolate whether the problem is with the piping from git log or with git-split-diffs itself.
Check git-split-diffs version and diff-so-fancy version:
powershell
git-split-diffs --version
diff-so-fancy --version
Ensure you have reasonably up-to-date versions. You can update them with npm update -g git-split-diffs diff-so-fancy.
Direct Git Configuration (Recommended for regular use):
Once you get it working via pipes, you'll likely want to configure Git to use git-split-diffs automatically.
Add this to your ~/.gitconfig:
And it should use git-split-diffs automatically.
Important for this configuration: If you configure it this way, you need to ensure GIT_SPLIT_DIFFS_DISABLE_PAGER is not set, or that git-split-diffs's internal pager (which calls less -R by default) is working correctly. If you set the core.pager as above, git-split-diffs becomes the pager.
Start with steps 1, 2, and 3, as they are the most common culprits.
If diff-so-fancy itself isn't working side-by-side (step 2), focus on getting that to work first.
If diff-so-fancy works but git-split-diffs doesn't, then the pager (step 3) or the interaction between git-split-diffs and diff-so-fancy is likely.