Skip to content

Latest commit

 

History

History
executable file
·
23 lines (15 loc) · 500 Bytes

list-commits-on-a-branch.md

File metadata and controls

executable file
·
23 lines (15 loc) · 500 Bytes

List Commits On A Branch

Category: Git

You can list commits for a specific branch with the following command:

git log main

Use the oneline flag to display the commits for a specific branch in a verbose format:

git log main --oneline

The output of the log is a separate line showing the hash and the message for each specific commit.

Alternatively, list all commits for a branch since it was branched:

git log main..feature-branch-name --oneline