Forrest logo
back to the git tool

git-rev-list:tldr:a2a40

git-rev-list: List all merge commits on a specific commit.
$ git rev-list --merges ${commit}
try on your machine

The command "git rev-list --merges ${commit}" is used in Git to list all the merge commits that are ancestors of a specific commit. Here is the breakdown of the command:

  • "git rev-list" is a Git command used to output a list of commit objects in reverse chronological order.
  • "--merges" is an option used with "git rev-list" to filter the output to include only merge commits. Merge commits are created when two or more branches are combined.
  • "${commit}" is a placeholder representing a specific commit object or commit reference. It could be a commit hash, branch name, or any valid Git reference.

In summary, the command "git rev-list --merges ${commit}" will list all the merge commits that are ancestors of the specified commit.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool