Behavior of "git push --mirror repo"

2 messages, 1 author, 2016-06-15 · open the first message on its own page

Behavior of "git push --mirror repo"

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 22:52:19

Hi,

I cloned a repository from "origin" to my local disk. I only have a local branch for "master", although there are more remote branches. Now I want to initialize a new empty bare repository with an exact copy of the repository, including all branches, also those remote branches that I have no local branch for. So I did:

$ git remote add sf <url>
$ git push --mirror sf

Which prints:

 * [new branch]      master -> master
 * [new branch]      refs/notes/commits -> refs/notes/commits
 * [new branch]      refs/original/refs/heads/master -> refs/original/refs/heads/master
 * [new branch]      origin/HEAD -> origin/HEAD
 * [new branch]      origin/bourke -> origin/bourke
 * [new branch]      origin/colorscheme -> origin/colorscheme
 * [new branch]      origin/cpuinfo -> origin/cpuinfo
 * [new branch]      origin/demo-ssao -> origin/demo-ssao
 * [new branch]      origin/master -> origin/master
 * [new branch]      origin/mesh-improvements -> origin/mesh-improvements
 * [new branch]      origin/mesh-iterators-subdiv -> origin/mesh-iterators-subdiv
 * [new tag]         gale2-static-dummy-window -> gale2-static-dummy-window

In the target repository "sf" I now alony have the "master" branch and the "gale2-static-dummy-window" tag, but none of the remote branches from "origin". I was reading the --mirror option as if this should happen:

 * [new branch]      origin/bourke -> sf/bourke

etc.

Is this behavior expected? If yes, what the correct way to mirror a repository then (without creating a local branch for each remote branch first)?

Thanks.

-- 
Sebastian Schuberth

Re: Behavior of "git push --mirror repo"

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 22:52:19

On 25.10.2011 12:25, Sebastian Schuberth wrote:
I cloned a repository from "origin" to my local disk. I only have a
Got it: I was missing "--bare" when doing my clone.

-- 
Sebastian Schuberth
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help