{"thread":{"id":"20363","subject":"How to fetch all remote branches from remote?","startedAt":"2009-08-03T22:20:43Z","lastAt":"2009-08-04T00:17:20Z","messageCount":2,"participants":["skillzero@gmail.com","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119440","messageId":"2729632a0908031520n71514fffne0667c6b229f836f@mail.gmail.com","threadId":"20363","inReplyTo":null,"subject":"How to fetch all remote branches from remote?","fromName":"","fromEmail":"skillzero@gmail.com","sentAt":"2009-08-03T22:20:43Z","receivedAt":"2009-08-03T22:20:43Z","isPatch":false,"sender":{"key":"skillzero@gmail.com","avatar":null},"body":"Is there a way to fetch all the remote branches of a remote? I have\none computer that cloned a repository from a server and I want clone\nthat computer's repository to another computer, but it only brings\nover the local branches from the clone. I'd like to also get all the\nremote branches so it's the same as if I had cloned directly from the\nserver. Just as if I had cp -R'd the .git folder (except with the\nremote tracking info I get when I clone). The source computer's\nrepository is using git-svn so I'm trying to make a copy of that\nrepository in a way that I can just push and pull changes to the\nintermediate git svn repository then later do the final git svn\ndcommit.\n\nIs the best way to just copy the whole .git folder to the destination\ncomputer and then add the original as a remote? That's a last resort\nfor me because as new svn branches are created, I'd like to pick them\nup when I do git pull's from the second computer.\n"},{"id":"119446","messageId":"eaa105840908031717x43803dbbqbca126a9bc11f887@mail.gmail.com","threadId":"20363","inReplyTo":"2729632a0908031520n71514fffne0667c6b229f836f@mail.gmail.com","subject":"Re: How to fetch all remote branches from remote?","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2009-08-04T00:17:20Z","receivedAt":"2009-08-04T00:17:20Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Mon, Aug 3, 2009 at 6:20 PM, <skillzero@gmail.com> wrote:\n> Is there a way to fetch all the remote branches of a remote?\n\ngit config --add remote.$remote.fetch +refs/remotes/*:refs/remotes/*; git fetch\n\n> I have\n> one computer that cloned a repository from a server and I want clone\n> that computer's repository to another computer, but it only brings\n> over the local branches from the clone. I'd like to also get all the\n> remote branches so it's the same as if I had cloned directly from the\n> server. Just as if I had cp -R'd the .git folder (except with the\n> remote tracking info I get when I clone). The source computer's\n> repository is using git-svn so I'm trying to make a copy of that\n> repository in a way that I can just push and pull changes to the\n> intermediate git svn repository then later do the final git svn\n> dcommit.\n\nThe above is what I use to set up my working copies from a\ncron-enabled git-svn mirror.\n\nAlso,  if you're pushing instead of dcommitting from each clone, you\nmay wish to read  this thread:\nhttp://thread.gmane.org/gmane.comp.version-control.git/111356/focus=112156\n- your setup probably isn't that complex, but you might want to be\naware of some of the issues you might face in the \"forced rebase\"\nenvironment of svn.\n\nPeter Harris\n"}]}