@kyanny's blog

My thoughts, my life. Views/opinions are my own.

Git: how to list the commits on the branch

git log branch-name --not default-branch-name --oneline

(default-branch-name should be the name of the default branch, such as main, master etc.).

For example, in https://github.com/actions/runner repo, brcrista/makefiles branch has 7 commits.

f:id:a666666:20211105172535p:plain

❯ git log brcrista/makefiles --not main --oneline
d8a53aa (HEAD -> brcrista/makefiles, origin/brcrista/makefiles) Remove dead code
9fe65b8 Fix detecting if the step is run: make
ec420ba Try adding steps in JobExtension
07cda74 Create a new step host for each sub-step
9ca1323 Detect Makefiles and parse out the targets
a5a0f8d Revert "Add GNUMakeManager"
ccf5333 Add GNUMakeManager

stackoverflow.com