threads / discuss / 27325

How do I push all remote branches to a new/different remote?

Subject: How do I push all remote branches to a new/different remote?

## tl;dr

3 messages between May 11, 2011 and May 11, 2011.

replies: 2people: 2as markdown or json

Howard Miller· May 11, 2011, 09:55 UTC · lore

I simply want to move an existing repository 'as is' from one place to another (the another being github fwiw). I would like to keep all the branch information intact.

That is,

git clone ...existing remote repo... cd .. git remote add ...new remote repo.. git push ...you tell me..

So, there are *no* local branches to bother about, but I have hundreds of remote ones. I can't spot a way to do this.

Junio C Hamano· May 11, 2011, 18:00 UTC · re: Howard Miller · lore

Re: How do I push all remote branches to a new/different remote?

Howard Miller <howard@e-learndesign.co.uk> writes:
> git push ...you tell me..
You can say "please" here ;-)  Shouldn't this work?
	git push $that_url 'refs/*:refs/*'
Howard Miller· May 11, 2011, 18:33 UTC · re: Junio C Hamano · lore

Re: How do I push all remote branches to a new/different remote?

On 11 May 2011 19:00, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Howard Miller <howard@e-learndesign.co.uk> writes:
>
>> git push ...you tell me..
>
> You can say "please" here ;-)  Shouldn't this work?
>
>        git push $that_url 'refs/*:refs/*'
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

"please" very much meant and thank you very much. I was expecting some option I had missed but I wouldn't have worked that out.

What I don't quite understand is what does --mirror do? I am assuming it pushed all the data but none of the branches which, on the face of it, doesn't seem very useful.

← back to recent threads