Skip to main content

Cherry-pick commits across GitHub repositories using only the GitHub API - no local clone required

Project description

GitHub cherry-pick

Cherry-pick commits across GitHub repositories using only the GitHub API - no local clone required.

How it works

Uses the algorithm described by Jim's Stack Overflow answer to perform a cherry-pick entirely through the GitHub REST API:

Installation

Requires Python 3.10+, I recommend using uv, but it will work fine with pip or anything else.

uv tool install gh-cherry-pick

Or run directly without installing:

uvx gh-cherry-pick --help

Usage

gh-cherry-pick --target OWNER/REPO@BRANCH COMMITS...

Arguments:

Argument Format Description
--target Owner/RepoName@branch Target repository and branch to apply the cherry-picks to
COMMITS Owner/RepoName/sha One or more commits to cherry-pick (short or full SHA)
--token, -t string GitHub token (falls back to $GITHUB_TOKEN)

Example:

GITHUB_TOKEN=ghp_... gh-cherry-pick \
  --target MyOrg/nixpkgs@patched \
  NixOS/nixpkgs/3f5ba52cc4701bf341457dfe5f6cb58e0cbb7f83 \
  NixOS/nixpkgs/49ba75edefc8dc4fee45482f77a280ddd7121797

Multiple commits are applied in order, each building on the previous result.

Development

uv sync
uv run pre-commit install

Then commit your changes and send a pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gh_cherry_pick-1.1.1.tar.gz (61.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gh_cherry_pick-1.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file gh_cherry_pick-1.1.1.tar.gz.

File metadata

  • Download URL: gh_cherry_pick-1.1.1.tar.gz
  • Upload date:
  • Size: 61.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gh_cherry_pick-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f4ba3f192b10df0ec722d33e69b418cf7a280752f28967243825760ea2e953bb
MD5 9e360bb80986c10b5cf6e1fc0cd88005
BLAKE2b-256 0113adf05449275adfadd80c96088ed23e8c691f1a06dfcf96eaaa1b8d7bf105

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_cherry_pick-1.1.1.tar.gz:

Publisher: publish.yml on PerchunPak/gh-cherry-pick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gh_cherry_pick-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: gh_cherry_pick-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gh_cherry_pick-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bef0b31a43ae9ff25828156634740be49b8d1f2319b05936d8ac15bae2db2e96
MD5 00f0f6c4f8ed76c580356b6e89fe7cdf
BLAKE2b-256 b7fe9090bfa42b8e1f877e65bfa15bfee8abacb968cf86d6e94a549a6955cf63

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_cherry_pick-1.1.1-py3-none-any.whl:

Publisher: publish.yml on PerchunPak/gh-cherry-pick

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page