Felipe Espinoza @craftingswift.dev · Jan 21

Today I learned about a git command I missed many times. ``` $ git merge-base commitA commitB ``` It will find the most recent common ancestor between those two commits.

0 likes 1 replies

?

Replies

Felipe Espinoza · Jan 21

Useful for example: - To see only the changes in a branch `git difftool $(git merge-base main HEAD)...HEAD ` - To see the commit logs from a branch `git log --oneline $(git merge-base main HEAD)...HEAD