Question

Is it possible to take a repository (such as CakePHP1.x @ http://github.com/cakephp/cakephp1x) and checkout the master plus branches into sub-folders?

For example, my desired folder structure would be like this:

cakephp1.x

|------ 1.2

|------ 1.3

|------ master

I know you can use git checkout -t origin/branch to switch between branches from a cloned repository, but I was wondering if there was a way to do the above without having to clone the repository and rename repeatedly.

Was it helpful?

Solution

You could do something like this:

mkdir cakephp
cd cakephp
git clone git://github.com/cakephp/cakephp1x.git master
cd master
git checkout -t origin/1.2
git checkout -t origin/1.3
cd ..
git clone master 1.2
git clone master 1.3
cd 1.2
git checkout -t origin/1.2

The two local git clone operations will be very quick because they will use hard links to share most of the repository data.

OTHER TIPS

cloning the repository is not a very big deal. If it happends on a local filesystem most of the repository contents is cloned via hard links.

Somehow related to this ?!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top