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.0.tar.gz (61.3 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.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_cherry_pick-1.1.0.tar.gz
  • Upload date:
  • Size: 61.3 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.0.tar.gz
Algorithm Hash digest
SHA256 ba0a1551c75cc702170f6fd180b9b764846a924bae7dea3b8c830383febb5242
MD5 2178a5598e4597f31a42fb0d692437a0
BLAKE2b-256 92b9c9c69104ff52ff8614798ebb09ea7421fd7e06b87215dd38f9f21eb1a7f8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gh_cherry_pick-1.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57db989ce4156ba5fa9afdeb97b53525bfb6a55c29d80aac88d84497a32f4df6
MD5 a4082b21b9a2ad998500650254b0f5a1
BLAKE2b-256 c37d1c9aa0c5b336a22b52a2c06900a37338de2ebcbb0921c5c51e9963fdc038

See more details on using hashes here.

Provenance

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