{"thread":{"id":"17705","subject":"how to clone all branches include remote branches","startedAt":"2009-02-10T17:49:12Z","lastAt":"2009-02-10T18:05:42Z","messageCount":2,"participants":["gnu kevin","Johannes Gilger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104052","messageId":"95463c700902100949w23a95536re9a65a2e5c3c0b5d@mail.gmail.com","threadId":"17705","inReplyTo":null,"subject":"how to clone all branches include remote branches","fromName":"gnu kevin","fromEmail":"kevin.gnu.zhang@gmail.com","sentAt":"2009-02-10T17:49:12Z","receivedAt":"2009-02-10T17:49:12Z","isPatch":false,"sender":{"key":"kevin.gnu.zhang@gmail.com","avatar":null},"body":"hi,\n\nI'd like to know how to get all remote(grandparent) branches by clone\na remote repo . for example:\nremote repo ABC contains below branches:\nmaster\nstable/main\ndev/main\n\nwhile master is the local branch in remote repo and stable/main &\ndev/main is two remote branches of that remote repo, when I clone from\nABC repo, I can only get a copy of ABC's local branch master, how can\nI get those two remote(grandparent) branches also copied?\n\nBRs,\nKevin\n"},{"id":"104053","messageId":"gmsflm$sd4$1@ger.gmane.org","threadId":"17705","inReplyTo":"95463c700902100949w23a95536re9a65a2e5c3c0b5d@mail.gmail.com","subject":"Re: how to clone all branches include remote branches","fromName":"Johannes Gilger","fromEmail":"heipei@hackvalue.de","sentAt":"2009-02-10T18:05:42Z","receivedAt":"2009-02-10T18:05:42Z","isPatch":false,"sender":{"key":"heipei@hackvalue.de","avatar":"https://avatars.githubusercontent.com/u/6072?v=4"},"body":"On 2009-02-10, gnu kevin <kevin.gnu.zhang@gmail.com> wrote:\n> I'd like to know how to get all remote(grandparent) branches by clone\n> a remote repo . for example:\n> remote repo ABC contains below branches:\n> master\n> stable/main\n> dev/main\n\nYou could (if your .git/config) already contains the remote simply add a \nline:\nfetch = +refs/remotes/*:refs/remotes/<remote-name>/remotes/*\n\nThe double remotes is used so that no remote-remote-branch can overwrite \nyour tracking branch with the same name.\n\nHope that helped,\nJojo\n\n-- \nJohannes Gilger <heipei@hackvalue.de>\nhttp://hackvalue.de/heipei/\nGPG-Key: 0x42F6DE81\nGPG-Fingerprint: BB49 F967 775E BB52 3A81  882C 58EE B178 42F6 DE81\n"}]}