Skip to content

134130/gh-cherry-pick

Repository files navigation

gh-cherry-pick

A GitHub CLI extension to cherry-pick a PR's merged commit based on target branch.

Description

  • It will be useful when you are using to cherry-pick a PR, which is merged to the main branch, to the release branch.

image

Installation

gh extension install 134130/gh-cherry-pick

Usage

  • gh cherry-pick -pr <pr_number> -onto <target_branch> [-merge auto|squash|rebase] [-push] to cherry-pick a PR based on target branch. It determines the merge strategy based on the original PR's merge strategy.
  • gh cherry-pick -pr <pr_number> -onto <target_branch> -merge squash to cherry-pick a PR's merged commit based on target branch.
  • gh cherry-pick -pr <pr_number> -onto <target_branch> -merge rebase to cherry-pick all the commits from a PR based on target branch.

Related

  • gh-domino - A GitHub CLI extension to rebase stacked pull requests
  • gh-poi - A GitHub CLI extension to safely clean up local branches you no longer need

Alterantives

  • In case one wants to base on a branch being squash-merged into main and avoid git showing conflicts, one can use magic-merge-commit to create a merge commit satisfying git and enabling a clean merge of main again.

About

🍒 Cherry-pick your pull requests to another branch

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •