threads / discuss / 32691

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

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

## tl;dr

2 messages between Jan 22, 2013 and Jan 22, 2013.

replies: 1people: 2as markdown or json

Andrey Borzenkov· Jan 22, 2013, 12:43 UTC · lore

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?

bor@opensuse:~> git --version git version 1.7.10.4

TIA
-andrey
Junio C Hamano· Jan 22, 2013, 16:59 UTC · re: Andrey Borzenkov · lore

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

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.

← back to recent threads