Forrest logo
back to the git tool

git-cherry:tldr:ac57d

git-cherry: Show commits (and their messages) with equivalent commits upstream.
$ git cherry -v
try on your machine

The command git cherry -v is used to display the commits that are present in one branch but missing in another branch. It provides a list of commits that have been applied to the source branch but not merged to the destination branch.

The -v option stands for "verbose" and it includes additional information in the output. When used with git cherry, it displays the commit ID, commit message, and the specific line(s) of code that introduced the change.

Here's an example of how the git cherry -v command can be used:

  1. Suppose you have two branches: master and feature.
  2. You want to see the commits that have been applied to the feature branch but are not present in the master branch.
  3. Run git cherry -v master feature.
    • This command compares the master branch with the feature branch.
    • It provides a list of commits that have been applied to feature but not merged into master.
    • The verbose option (-v) includes additional information about each commit, such as the commit ID, commit message, and the specific line(s) of code that introduced the change.
  4. The output will show a list of commits along with their associated information, making it easier to identify the differences between the branches.
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