summaryrefslogtreecommitdiff
path: root/t/t4013/diff.diff_initial..side
diff options
context:
space:
mode:
authorHarald Nordgren <haraldnordgren@gmail.com>2026-06-27 18:02:24 +0000
committerJunio C Hamano <gitster@pobox.com>2026-06-27 19:36:43 -0700
commit2faf0f0256cbf4cef447202276ca57d36e1d9380 (patch)
tree420e6cf1db9289ba7ae23146b10725a503848d93 /t/t4013/diff.diff_initial..side
parent4621f8ce5e9b97aa2e8d0d9ffe9d25df2471074d (diff)
branch: suggest <remote>/<branch> on upstream slip
When setting the upstream of the current branch to the 'main' branch of the remote 'origin', i.e., $ git branch --set-upstream-to origin/main it is easy to mistakenly write $ git branch --set-upstream-to origin main That is parsed as a request to set the upstream of the local branch 'main' to 'origin'. When 'main' does not exist, the command dies with: fatal: branch 'main' does not exist pointing at a branch the user never meant to name. When 'main' does exist, it instead dies with: fatal: the requested upstream branch 'origin' does not exist leaving the user equally puzzled. When the operated-on branch is missing and '<remote>/<branch>' names a real remote-tracking ref, suggest the intended form: $ git branch --set-upstream-to=origin/main The suggestion is gated on '<remote>/<branch>' existing so it only appears when a slipped slash is the likely explanation. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions