Rebase a pull request against its target base branch (from the PR's merge target) and force push the updates. If no PR number is specified, rebases all open PRs.
Rebase a PR or all open PRs against their target branches and force push updates. Use this to update stale PRs with the latest base branch changes before merging.
/plugin marketplace add yanmxa/cc-plugins/plugin install git@cc-pluginsRebase a pull request against its target base branch (from the PR's merge target) and force push the updates. If no PR number is specified, rebases all open PRs.
/git:rebase-pr [remote]
/git:rebase-pr <pr_number> [remote]
gh pr view <pr_number> --json baseRefName,headRepository,isCrossRepository to get:
baseRefName: The target branch this PR will merge into (e.g., "main", "develop")headRepository: The source repository infoisCrossRepository: Whether this is a fork PRremote argument is provided: Use <remote>/<baseRefName>upstream/<baseRefName>origin/<baseRefName>git fetch <remote> to ensure we have the latest commits from the target remotegh pr checkout <pr_number><remote>/<baseRefName>--force-with-lease to update the PR safelygh pr list --author "@me" --state open --json number,headRefName,baseRefName,isCrossRepository to get all user's open PRs with their target branchesgit worktree list to identify which PRs are in worktrees vs main directorybaseRefName and isCrossRepository from the PR listupstream for forks, or origin for same-repo PRsgit fetch <remote>git rebase <remote>/<baseRefName>gh pr checkout <pr_number> then rebase against <remote>/<baseRefName>--force-with-lease, mark as completedgit addgit rebase --continuepr_number: The GitHub PR number to rebase (optional, if not provided will rebase all open PRs)remote: The remote name to fetch and rebase against (optional, defaults to upstream for fork PRs or origin for same-repo PRs)# Rebase all open PRs against their target branches (auto-detects upstream/origin)
/git:rebase-pr
# Rebase all open PRs, explicitly using upstream remote
/git:rebase-pr upstream
# Rebase all open PRs using origin remote
/git:rebase-pr origin
# Rebase single PR #2067 against its target branch (auto-detects remote)
/git:rebase-pr 2067
# Rebase single PR #2067 using upstream remote
/git:rebase-pr 2067 upstream
# Rebase single PR #2067 using origin remote
/git:rebase-pr 2067 origin
baseRefName) rather than a hardcoded branch. For example:
main → rebases against upstream/main or origin/maindevelop → rebases against upstream/develop or origin/developrelease-1.0 → rebases against upstream/release-1.0 or origin/release-1.0isCrossRepository: true): Defaults to upstream remoteorigin remote--force-with-lease for safer force pushing that prevents overwriting unexpected changesgh) must be authenticatedupstream or origin) must be configured