Interview Prep/Git & GitHub/Commits, branches and tags

What is the difference between `git log --oneline --graph` and `--first-parent`?

IntermediateConceptCommits, branches and tags
Answer

--graph draws every commit including those from merged branches. --first-parent follows only the first parent of each merge, so on a main branch that uses merge commits you see one entry per merged PR. It is the best view of "what landed when" and works well with bisect --first-parent.

git log --oneline --first-parent main
All Git & GitHub questions Roadmap: Git & GitHub

More on Commits, branches and tags