I'd like to compare two branches that have diverged significantly. I would also like to limit my comparison to a particular subdirectory where the files were moved in only one of the branches.
Example layout:
branch-a
└── sub
    ├── file1
    ├── file2
    └── file3
branch-b
├── file2
├── file3
└── file4
Running git diff -M branch-b from branch-a correctly diffs the files, but it includes all changes, not just those in sub. I've tried using --relative, but that seems to prevent move detection.
I figured it out:
git diff branch-a:sub branch-b
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With