gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

`gh stack link` does not respect the default branch of a repository

Open tylerjohnst opened this issue 4 months ago • 1 comments

When linking an existing stack with gh link 1 2 3 and --base is not given, it defaults to main not the default repository branch. As a result, the first PR of the stack is retargeted to main and currently there is no easy way to change the base of the stack.

tylerjohnst avatar Jul 21 '26 20:07 tylerjohnst

link currently has a hardcoded default to main: https://github.com/github/gh-stack/blob/38aba1b7106d274af317b20686ddc81d706cd00f/cmd/link.go#L80

but it should follow the same dynamic base branch resolution that is used in init: https://github.com/github/gh-stack/blob/38aba1b7106d274af317b20686ddc81d706cd00f/cmd/init.go#L75

skarim avatar Jul 22 '26 03:07 skarim