I recently took a branch with a lot of commits and merged it back into my master branch. If I needed to go back and see how many lines were added or deleted because of that merge, how would I go about doing that?
git diff has a --shortstat option which would have been useful before the merge as then you could've just done git diff --shortstat ..branch/to/merge from your main branch.
If the merge wasn't a fast-forward, then you'll have generated a merge commit. That will have the parent information for both branches. You can use those to do git diff --shortstat parent1..mergecommit to show what changes happened when moving from the first parent (your main branch) to the result of the merge commit.
If the merge was a fast-forward, then you just need to know what the sha1 of your branch was before the merge and compare that to the current. You could probably get that from git reflog.
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