For example, when I merge from master -> production, I'd like to see a list of the commits before I, err, commit to them. Something like:
$ git merge --doublecheck master
Commits to merge:
1292642 fix foo
3c0f30b cleanup bar
Do you want to proceed? (y/n)
You can use revision range double-dot .. syntax to do this:
git log --oneline --graph <branch-to-merge-into>..<branch-to-be-merged>
The output will be all commits in <branch-to-be-merged> that aren't in <branch-to-merge-into>.
You can learn more about this and other revision range syntaxes in the Commit Ranges section of the FREE online Pro Git book.
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