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

Re: branch name in remote.<remote>.push is not updated after "git branch -m"

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2013, 16:59 UTC
Message-ID
<7v622pb1ck.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130122164306.3dc8b757@opensuse.site>
Andrey Borzenkov <arvidjaar@gmail.com> writes:
Show 14 quoted lines
> I renamed branches and noticed that branch name was not changed in
> remote push config. I.e. after
>
> bor@opensuse:~/src/bootinfoscript> git branch -m github master
>
> I still have
>
> [remote "github"]
>         push = github:master
>         url = git://github.com/arvidjaar/bootinfoscript.git
>         pushurl = git@github.com:arvidjaar/bootinfoscript.git
>         fetch = +refs/heads/*:refs/remotes/github/*
>
> Is it expected behavior or possibly already fixed?
Isn't that line added manually by you?

If the line were written in a canonical and an explicit way (i.e. "push = refs/heads/github:refs/heads/master"), it might be nicer if "git branch -m" noticed it and adjusted the LHS of the refspec, but even that is dubious.

The move of the old github to master by the user may well have been because the user realized that he added something that is not ready to be pushed out to the branch, and the next move by the end user could be to create a github branch anew that points at an earlier part of the history that is ready to be pushed, while keeping the invariant "my local github branch is what I will publish".

So, in short, it is expected, and no, I do not think changing it to "push = master:master" is necessarily an improvement.

Previous: Andrey Borzenkov
Message 2 of 2 in “branch name in remote.<remote>.push is not updated after "git branch -m"”
  1. Andrey BorzenkovJan 22, 2013
  2. Junio C HamanoJan 22, 2013

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.