Quick way to clone exactly one branch
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- May 20, 2009, 20:45 UTC
- Message-ID
- <32541b130905201345h6daa84e8hb937e1e46456b3c5@mail.gmail.com>
Hi all,
Is there a quick alternative to the following?
mkdir myproj cd myproj git init git fetch git://whatever master git checkout -b master FETCH_HEAD
Basically, the above is a lot like 'git clone' but only clones the 'master' branch. For really big projects with lots of junk in other branches, the above can save a lot of bandwidth.
Also, if I were using git clone, I would often use --reference above. I'm kind of afraid of explaining to a newbie that they should add an entry to .git/objects/info/alternates after step 3.
Am I missing something obvious?
Have fun,
Avery