{"thread":{"id":"28761","subject":"Behavior of \"git push --mirror repo\"","startedAt":"2011-10-25T10:25:10Z","lastAt":"2011-10-25T12:46:22Z","messageCount":2,"participants":["Sebastian Schuberth"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178261","messageId":"j862ts$d75$1@dough.gmane.org","threadId":"28761","inReplyTo":null,"subject":"Behavior of \"git push --mirror repo\"","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2011-10-25T10:25:10Z","receivedAt":"2011-10-25T10:25:10Z","isPatch":false,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"Hi,\n\nI 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:\n\n$ git remote add sf <url>\n$ git push --mirror sf\n\nWhich prints:\n\n * [new branch]      master -> master\n * [new branch]      refs/notes/commits -> refs/notes/commits\n * [new branch]      refs/original/refs/heads/master -> refs/original/refs/heads/master\n * [new branch]      origin/HEAD -> origin/HEAD\n * [new branch]      origin/bourke -> origin/bourke\n * [new branch]      origin/colorscheme -> origin/colorscheme\n * [new branch]      origin/cpuinfo -> origin/cpuinfo\n * [new branch]      origin/demo-ssao -> origin/demo-ssao\n * [new branch]      origin/master -> origin/master\n * [new branch]      origin/mesh-improvements -> origin/mesh-improvements\n * [new branch]      origin/mesh-iterators-subdiv -> origin/mesh-iterators-subdiv\n * [new tag]         gale2-static-dummy-window -> gale2-static-dummy-window\n\nIn 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:\n\n * [new branch]      origin/bourke -> sf/bourke\n\netc.\n\nIs this behavior expected? If yes, what the correct way to mirror a repository then (without creating a local branch for each remote branch first)?\n\nThanks.\n\n-- \nSebastian Schuberth\n"},{"id":"178263","messageId":"4EA6AF9E.30201@gmail.com","threadId":"28761","inReplyTo":"j862ts$d75$1@dough.gmane.org","subject":"Re: Behavior of \"git push --mirror repo\"","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2011-10-25T12:46:22Z","receivedAt":"2011-10-25T12:46:22Z","isPatch":false,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On 25.10.2011 12:25, Sebastian Schuberth wrote:\n\n> I cloned a repository from \"origin\" to my local disk. I only have a\n\nGot it: I was missing \"--bare\" when doing my clone.\n\n-- \nSebastian Schuberth\n"}]}