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

3 messages from 2011-05-11 to 2011-05-11. Participants: Howard Miller, Junio C Hamano.
Thread: https://gitlist.dev/t/27325

## Howard Miller, 2011-05-11 09:55

Subject: How do I push all remote branches to a new/different remote?
Message-ID: <BANLkTi=EtRPcjaeCRNgLQ39JsqzS=_69hA@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTi%3DEtRPcjaeCRNgLQ39JsqzS%3D_69hA%40mail.gmail.com

```
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, 2011-05-11 18:00

Subject: Re: How do I push all remote branches to a new/different remote?
Message-ID: <7vy62df77q.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy62df77q.fsf%40alter.siamese.dyndns.org
In-Reply-To: <BANLkTi=EtRPcjaeCRNgLQ39JsqzS=_69hA@mail.gmail.com>

```
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, 2011-05-11 18:33

Subject: Re: How do I push all remote branches to a new/different remote?
Message-ID: <BANLkTi=JBMf8t=PQo13pVYd03wczsyjMtA@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTi%3DJBMf8t%3DPQo13pVYd03wczsyjMtA%40mail.gmail.com
In-Reply-To: <7vy62df77q.fsf@alter.siamese.dyndns.org>

```
On 11 May 2011 19:00, Junio C Hamano <gitster@pobox.com> wrote:
> 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.

```
