Git Clone Parameter

2013-07-19 Thread Allan Acheampong
Hi, it would be nice to have a parameter on 'git clone' that not only clones the repo, but also creates local branches for ALL the branches that are in the repo. I'm new to git, but I found it very confusing to understand the difference between remote , remotes. Is it in the cloned repo, or is

Re: Git Clone Parameter

2013-07-19 Thread Ramkumar Ramachandra
Allan Acheampong wrote: I could write a script with for each in but thats way too much hassle $ git for-each-ref --format=%(refname) refs/remotes/origin/ | sed 's/refs\/remotes\/origin\///;/HEAD\|master/d' | xargs git checkout -b (completely untested ofcourse) Do you see what the problem is

Re: Git Clone Parameter

2013-07-19 Thread Johannes Sixt
Am 7/19/2013 11:21, schrieb Allan Acheampong: Something like 'git clone theRepo -createLocalBranchesForAllBranches' Perhaps: $ git clone theRepo $ git fetch origin refs/heads/*:refs/heads/* (untested). There may be ways to write the same shorter, but I've lost track of what is and what is not

Re: Git Clone Parameter

2013-07-19 Thread Junio C Hamano
Johannes Sixt j.s...@viscovery.net writes: Am 7/19/2013 11:21, schrieb Allan Acheampong: Something like 'git clone theRepo -createLocalBranchesForAllBranches' Perhaps: $ git clone theRepo $ git fetch origin refs/heads/*:refs/heads/* (untested). There may be ways to write the same

Re: Git Clone Parameter

2013-07-19 Thread Junio C Hamano
Ramkumar Ramachandra artag...@gmail.com writes: Allan Acheampong wrote: I could write a script with for each in but thats way too much hassle $ git for-each-ref --format=%(refname) refs/remotes/origin/ | sed 's/refs\/remotes\/origin\///;/HEAD\|master/d' | xargs git checkout -b

Re: Git Clone Parameter

2013-07-19 Thread Junio C Hamano
Allan Acheampong allanad...@gmail.com writes: ... I'm new to git, but I found it very confusing to understand the difference between remote , remotes. Is it in the cloned repo, or is it in a remote place? If its local, why doesn't it get shown when I do 'git branch' but when I do 'git branch

Re: Git Clone Parameter

2013-07-19 Thread Ramkumar Ramachandra
Junio C Hamano wrote: git branch -t $branchname origin/$branchname A couple of notes here: 1. I use git branch -u personally. Why the -t variant? 2. Don't we auto-track? (or is that only on checkout) -- To unsubscribe from this list: send the line unsubscribe git in the body of a

Re: Git Clone Parameter

2013-07-19 Thread Ramkumar Ramachandra
Junio C Hamano wrote: You would at least need xargs -n 1 for the produced command line to make any sense, and it is wasteful to actually check out each and every branch to the working tree only to create it. Right. xargs -n 1, git branch, and refname:short. -- To unsubscribe from this list:

Re: Git Clone Parameter

2013-07-19 Thread Philip Oakley
From: Junio C Hamano gits...@pobox.com Sent: Friday, July 19, 2013 4:02 PM Allan Acheampong allanad...@gmail.com writes: ... I'm new to git, but I found it very confusing to understand the difference between remote , remotes. Is it in the cloned repo, or is it in a remote place? If its local,

Re: Git Clone Parameter

2013-07-19 Thread Junio C Hamano
Philip Oakley philipoak...@iee.org writes: Allan Acheampong allanad...@gmail.com writes: ... I'm new to git, but I found it very confusing to understand the difference between remote , remotes. Is it in the cloned repo, or is it in a remote place? If its local, why doesn't it get shown when