Forrest logo
back to the git tool

git-rev-list:tldr:0a184

git-rev-list: Print the number of commits since a specific tag.
$ git rev-list ${tag_name}..HEAD --count
try on your machine

This command is used in Git to count the number of commits between a specific tag and the current commit (HEAD).

Here's a breakdown of the command:

  • git rev-list is a Git command used to list commit objects in reverse chronological order.
  • ${tag_name} is a placeholder that should be replaced with the name of the tag you want to compare.
  • .. is the range operator in Git. It specifies the range of commits you want to consider.
  • HEAD is a reference to the current commit or the commit at the tip of the current branch.
  • --count is an option in git rev-list that tells Git to display the total number of commits.

So when you run this command, Git will list all the commit objects between the specified tag (excluding the tag itself) and the latest commit, and then display the count of those commits.

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