threads / bug / 29958

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

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

## tl;dr

2 messages between Mar 15, 2012 and Mar 15, 2012.

replies: 1people: 2as markdown or json

Dave Borowitz· Mar 15, 2012, 15:51 UTC · lore
$ 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· Mar 15, 2012, 20:52 UTC · re: Dave Borowitz · lore

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

Dave Borowitz <dborowitz@google.com> writes:
Show 10 quoted lines
> $ 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.

← back to recent threads