Forrest logo
back to the git tool

git-cherry:tldr:86696

git-cherry: Specify a different upstream and topic branch.
$ git cherry ${origin} ${topic}
try on your machine

The command "git cherry ${origin} ${topic}" in Git is used to compare two branches and list the commits that are in the ${topic} branch but not in the ${origin} branch. Here's a breakdown of the command:

  • ${origin}: This is the name of the branch or commit that you want to compare against, typically the branch you originated your work from.
  • ${topic}: This is the name of the branch or commit that you want to compare, typically the branch where you made your changes.

By running this command, Git will display a list of commits that are in the ${topic} branch but not in the ${origin} branch. This can be helpful to identify the specific changes made in the ${topic} branch that are not present in the ${origin} branch.

Note: "${origin}" and "${topic}" are just placeholders in this explanation. In reality, you would replace them with the actual branch names or commit identifiers you want to compare.

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