Pregunta

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.

¿Fue útil?

Solución

I figured it out:

git diff branch-a:sub branch-b

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top