![Forrest logo](/images/logo.png)
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:
- Suppose you have two branches:
master
andfeature
. - You want to see the commits that have been applied to the
feature
branch but are not present in themaster
branch. - Run
git cherry -v master feature
.- This command compares the
master
branch with thefeature
branch. - It provides a list of commits that have been applied to
feature
but not merged intomaster
. - 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.
- This command compares the
- 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.