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

Github stack does not persist across worktrees

Open
#459 1 comment 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, github, go
Domain
cli, tooling

Research direction

Start with the gh stack init entry point and trace how local stack membership is stored when $GIT_DIR points into .git/worktrees/<name>/. Reproduce the behavior across a main worktree and a linked worktree, including worktree remove; done means stack membership remains available when the branch is opened from another worktree.

Written by the indexing model from the issue text.

Description

bug topic: cli - worktrees

When opening a branch in a worktree and running gh stack init, it does not keep track of the stack locally. gh-stack keeps stack membership in local state tied to the checkout where init ran. If I create a worktree & use gh-stack, the stack doesn't persist on my machine, even if I open the branch back in my main worktree. Inside a worktree, $GIT_DIR is .git/worktrees// — so worktree remove deletes the stack state with it

This is confusing & not obvious. Additionally, a modern LLM workflow may involve different sub-agents in different worktrees. This makes gh-stack worse than, say git-spice for this purpose, since I can't easily update my work if I checkout the branch on my main worktree.

The stack is stored remotely on Github, but THAT doesn't always work - seems like GitHub only records a stack for a chain of two or more PRs.

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.