Re: [PATCH] Disallow creating ambiguous branch names by default

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Disallow creating ambiguous branch names by default

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:51

Conrad Irwin [off-list ref] writes:
In the process of changing things around to do this, I noticed that

git checkout -M <foo> <current-branch>

surprisingly works,...
What is "-M" supposed to do???

If you meant "-B", that should work. When I want to rewrite a topic in a
non-trivial way, I would often do:

	$ git checkout HEAD^^^
        work to redo what the few commits at the tip should have done,
        creating commits.
        $ git diff @{-1} HEAD
        $ git checkout -B @{-1}

which often happens to be simpler and more flexible than the canned
rewriting options "rebase -i" can offer me.
... in that you will get a:

$ git rev-parse HEAD@{1}
warning: Log .git/logs/HEAD has gap after Fri, 19 Aug 2011 02:00:09 -0700
If that is the case, then the codepath to update the reflog is
broken. That is not a reason to forbid -B, though.

But because I do not know what you meant by "checkout -M", ...

Re: [PATCH] Disallow creating ambiguous branch names by default

From: Conrad Irwin <hidden>
Date: 2016-06-15 22:51:51

On Fri, Aug 19, 2011 at 1:49 PM, Junio C Hamano [off-list ref] wrote:
quoted
$ git rev-parse HEAD@{1}
warning: Log .git/logs/HEAD has gap after Fri, 19 Aug 2011 02:00:09 -0700
If that is the case, then the codepath to update the reflog is
broken. That is not a reason to forbid -B, though.

But because I do not know what you meant by "checkout -M", ...
Sorry, I meant git branch -M <foo> <current-branch>

Conrad
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help