[PATCH 0/2] branch/push: suggest intended form when remote/branch slip given
- From
Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jun 12, 2026, 11:10 UTC
- Message-ID
- <pull.2331.git.git.1781262619.gitgitgadget@gmail.com>
When the repository or upstream argument is a slip like "origin/main" or "origin main", suggest the intended "git push origin main" or "git branch --set-upstream-to=origin/main" form instead of failing with an unrelated error.
Harald Nordgren (2): branch: suggest <remote>/<branch> on upstream slip push: suggest <remote> <branch> for a slash slip
Documentation/config/advice.adoc | 5 +++++ advice.c | 1 + advice.h | 1 + builtin/branch.c | 17 ++++++++++++++ builtin/push.c | 26 +++++++++++++++++++++- t/t3200-branch.sh | 38 ++++++++++++++++++++++++++++++++ t/t5529-push-errors.sh | 31 ++++++++++++++++++++++++++ 7 files changed, 118 insertions(+), 1 deletion(-)
base-commit: 3e65291872de10c3f0bf05ea8c24187e7a71ebf0 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2331%2FHaraldNordgren%2Fsuggest-remote-branch-slips-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2331/HaraldNordgren/suggest-remote-branch-slips-v1 Pull-Request: https://github.com/git/git/pull/2331
-- gitgitgadget