How can you tell how two git branches differ?
If you want to see the difference in commits between two branches or commits, use
git show-branch
.In case you haven’t noticed yet, I think git merge
is sometimes overused. I like to keep commits organized and hygenic.
A rule of thumb for doing this is to only use git merge
if the merge will be a fast-forward merge. Otherwise this kind of thing can happen:
me/feature
branch, and you’re missing a commit from your mainline.git merge
.git fetch --all
git checkout me/feature
git merge origin/main
main
branch (when they’re ready for deployment or distribution or whatever),
your main
branch will also inherit this wonky merge commit. Do you find this awkward and noisy?So try to use git merge
as little as possible.
git show-branch
.