Automated Git Backport CLI Tool

11.0.2 · active · verified Wed Apr 22

Backport is an interactive CLI tool designed to streamline the process of backporting Git commits across multiple release branches. It automates the selection of commits and target branches, handles cherry-picking, pushes changes, and creates pull requests (PRs) on platforms like GitHub. The tool operates in a temporary directory, ensuring it never interferes with a user's local working copy or unstaged changes. Currently at stable version 11.0.2, it sees regular patch and minor releases, maintaining an active development pace. Its key differentiators include an intuitive interactive interface, non-intrusive operation, and a comprehensive workflow from commit selection to PR creation. A GitHub Action wrapping the CLI is also available for CI/CD integration.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates global installation, project-specific configuration with .backportrc.json, global access token setup, and interactive CLI execution.

{
  // .backportrc.json in repository root
  "repoOwner": "your-org",
  "repoName": "your-repo",
  "targetBranchChoices": ["main", "release/1.0", "release/2.0"],
  "autoMerge": true,
  "autoMergeMethod": "squash",
  "branchLabelMapping": {
    "^auto-backport-to-(.+)$": "$1"
  }
}

// ~/.backport/config.json (global config)
{
  "accessToken": "ghp_YOUR_VERY_SECRET_GITHUB_TOKEN"
}

// Terminal
npm install -g backport
npx backport

view raw JSON →