# [BUG?] git branch -m doesn't update tracked branch config

2 messages from 2012-03-15 to 2012-03-15. Participants: Dave Borowitz, Junio C Hamano.
Thread: https://gitlist.dev/t/29958

## Dave Borowitz, 2012-03-15 15:51

Subject: [BUG?] git branch -m doesn't update tracked branch config
Message-ID: <CAD0k6qRWR9H8BejcXx3gzy2yQT_MjRBDtbZzhLVM215HQiaVhg@mail.gmail.com>
URL: https://gitlist.dev/e/CAD0k6qRWR9H8BejcXx3gzy2yQT_MjRBDtbZzhLVM215HQiaVhg%40mail.gmail.com

```
$ git branch --track branch master
Branch branch set up to track local branch master.
$ git branch -m master newmaster
$ git branch -vv
  branch    e8fadc2 [master] foo
* newmaster e8fadc2 foo

I would have expected branch's upstream to now be newmaster rather
than master, or at the very least some warning that branch now has a
nonexistent upstream. Is this intended behavior, or a bug?

```

## Junio C Hamano, 2012-03-15 20:52

Subject: Re: [BUG?] git branch -m doesn't update tracked branch config
Message-ID: <7v7gylk2n8.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7gylk2n8.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAD0k6qRWR9H8BejcXx3gzy2yQT_MjRBDtbZzhLVM215HQiaVhg@mail.gmail.com>

```
Dave Borowitz <dborowitz@google.com> writes:

> $ git branch --track branch master
> Branch branch set up to track local branch master.
> $ git branch -m master newmaster
> $ git branch -vv
>   branch    e8fadc2 [master] foo
> * newmaster e8fadc2 foo
>
> I would have expected branch's upstream to now be newmaster rather
> than master, or at the very least some warning that branch now has a
> nonexistent upstream. Is this intended behavior, or a bug?

I think "branch -m A B" moves everything in "branch.A.*" over to
"branch.B.*" and does nothing else.

You would also want to find all Cs that have "branch.C.merge = A"
and "branch.C.remote = ." and update A in them to B, or something.

```
