gh-stack
gh-stack copied to clipboard
`gh stack link` does not respect the default branch of a repository
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.
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