I have a local Git repository called \'skeleton\' that I use for storing project skeletons. It has a few branches, for different kinds of projects:
casey@aga
Using Git version 1.7.3.1 (on Windows), here's what I do ($BRANCH
is the name of the branch I want to checkout and $REMOTE_REPO
is the URL of the remote repository I want to clone from):
mkdir $BRANCH
cd $BRANCH
git init
git remote add -t $BRANCH -f origin $REMOTE_REPO
git checkout $BRANCH
The advantage of this approach is that subsequent git pull
(or git fetch
) calls will also just download the requested branch.