Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature Request: Add `gh stack split` to split the current branch at a chosen commit

Open
#508 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
git, github, go
Domain
cli

Research direction

Start with the existing gh stack command entry point and the gh stack modify view, since the proposal suggests integrating interactive split selection there. Define the split behavior for the current branch, branches already above it, and pull-request identity, then verify that gh stack split supports the named branch and commit options and preserves the stated stack relationships.

Written by the indexing model from the issue text.

Description

Problem

A branch often grows into two or more reviewable concerns, splitting these after the fact is tedious
Today it requires a manual operation: insert 1 PR above, cherry pick commits from PR1 to new PR2, rebase
If more than 1 split is required, it's even more error prone manipulations

Proposal

gh stack split [<new-branch>] [--at <commit>]

  • Current branch keeps commits up to <commit>
  • <commit> and commits above move to <new-branch>, inserted directly above the current branch in the stack (if some PR are already stacked above current PR)
  • Branches already above are rebased onto the new layer; existing PRs keep their identity, the current PR's base is unchanged

Ideally, interactive mode lists the current branch's commits, user picks the split point and types the new branch name: this could happen in the gh stack modify view

Dominant language
Go
Stars
1.5k
Forks
73
Avg merge
1d 8h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/gh-stack

All issues in github/gh-stack

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.