To show the commit history for a specific branch in Git, you can use the following command:
bashgit log <branch_name>
Replace <branch_name>
with the name of the branch you're interested in.
For example, if you want to see the commit history for a branch named feature-branch
, you would use:
bashgit log feature-branch
This command will display a chronological list of commits for the specified branch, showing details such as commit hash, author, date, and commit message.
You can also add additional options to the git log
command to customize the output or view more details. For example:
git log --oneline <branch_name>
git log --graph <branch_name>
git log -n <number_of_commits> <branch_name>
Feel free to explore the various options available with the git log
command to tailor the output to your preferences.