--- source_keys: - context7-git-htmldocs --- # Comparing two branches The two-dot and three-dot forms mean different things and are easy to swap by accident — check the direction before reporting a result. - `git log main..feature` — commits on `feature` that are not on `main`. - `git log feature..main` — the reverse direction: commits on `main` not on `feature`. - `git log --left-right main...feature` — both diverging sets at once (symmetric difference). - `git diff main...feature` — the diff from the common ancestor to `feature`'s tip, which is what a reviewer sees, rather than the diff between the two tips. - `git merge-base main feature` — print the common ancestor commit.