How to resolve this ambiguity and is there is any different between the branches heads/origin/GRNDEV_893
and remotes/origin/GRNDEV_893
.
Git 2.23 (Q2 2019) will improve the code to show args with potential typo that cannot be interpreted as a commit-ish.
See commit 2ed2e19, commit 8ed51b0 (14 May 2019) by Jeff King (peff
).
(Merged by Junio C Hamano -- gitster
-- in commit 8d32d25, 13 Jun 2019)
help_unknown_ref()
: check for refname ambiguity
When the user asks to merge "foo
" and we suggest "origin/foo
" instead, we do so by simply chopping off "refs/remotes/
" from the front of the suggested ref.
This is usually fine, but it's possible that the resulting name is ambiguous (e.g., you have "refs/heads/origin/foo
", too).
Let's use shorten_unambiguous_ref()
to do this the right way, which
should usually yield the same "origin/foo
", but "remotes/origin/foo
" if
necessary.
Note that in this situation there may be other options (e.g., we could suggest "heads/origin/foo
" as well). I'll leave that up for debate; the focus here is just to avoid giving advice that does not actually do what we expect.
With Git 2.24, calling help_unknown_ref()
exits the program.
See commit 80e3658 (29 Aug 2019) by René Scharfe (rscharfe
).
(Merged by Junio C Hamano -- gitster
-- in commit 8e111e4, 30 Sep 2019)