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.0.0.tar.gz (61.2 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.0.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_cherry_pick-1.0.0.tar.gz
  • Upload date:
  • Size: 61.2 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.0.0.tar.gz
Algorithm Hash digest
SHA256 36303ac13baefc3dbc10597a9f24a1ebacfa3e7eac77fcf646218e514f7209e5
MD5 1f4fee7c9f5c801f417a806b0b3cce0e
BLAKE2b-256 bf5922beefd50d61b832f557e73e63179a2af9879c3ebc95d1a31dafa651f19c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_cherry_pick-1.0.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: gh_cherry_pick-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 911980c50a35b18dabe9c5583403b4e30110300254bf39ea136b7fdf7cb16881
MD5 3b5ffd19958307fd23a62de14169d5f1
BLAKE2b-256 9b0bdf57067fe7b5254b2cad70393dc62e9d278b2621372049c0e7e913704a48

See more details on using hashes here.

Provenance

The following attestation bundles were made for gh_cherry_pick-1.0.0-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