git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Mention that git-branch -M can cause problems for tracking branches

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 2, 2007, 20:14 UTC
Message-ID
<7vlk9g1k1q.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071102091734.GC10141@diku.dk>
Jonas Fonseca <fonseca@diku.dk> writes:
Show 24 quoted lines
> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
> ---
>  Documentation/git-branch.txt |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
>  I made a patch to discard the overwritten branch's configuration
>  section, which Spearce felt was too lossy a behaviour. However, since
>  it confused me, I think it should at least be mentioned in the manpage.
>  Maybe the warning message from git should also be added to improve its
>  "googlability".
>
> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> index 5e81aa4..def4e85 100644
> --- a/Documentation/git-branch.txt
> +++ b/Documentation/git-branch.txt
> @@ -165,6 +165,11 @@ If you are creating a branch that you want to immediately checkout, it's
>  easier to use the git checkout command with its `-b` option to create
>  a branch and check it out with a single command.
>  
> +When a branch is renamed so that it overwrites an existing branch unintended
> +problems can arise. This is because git refuses to discard the configuration
> +section of the overwritten branch. As a result git can become confused if, for
> +example, the branches involved were used for tracking two different remote
> +branches. The only way to fix this is to edit the configuration file manually.
I do not understand this bit about "refuse".
 - To "refuse to discard", somebody has to ask to discard ---
   who asks so and when?
 - Is there a reason to "refuse" when such a removal request is
   made?  If so, what is it?  If not, why refusal?
Previous: Jonas FonsecaNext: Jonas Fonseca
Message 2 of 4 in “Mention that git-branch -M can cause problems for tracking branches”
  1. Mention that git-branch -M can cause problems for tracking branchesJonas Fonseca, Nov 2, 2007
  2. Junio C HamanoNov 2, 2007
  3. Jonas FonsecaNov 2, 2007
  4. Junio C HamanoNov 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.