Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use git-svn to checkout only trunk and not branches and tags?

Tags:

git

svn

git-svn

I'm working on a Java legacy project which has 20 modules connected to each other. So, each module has it's own branch and tag. The structure is like this:

  /projects    .svn    - module1        .svn        -trunk        -branch        -tag    - module2        .svn        -trunk        -branch        -tag  

The projects folder is around 30 GB which is nearly impossible to use git-svn clone to checkout all the modules, but it's because it counts all the branches and tags.

Is it possible to just clone the project only trunk so I can start committing locally?

like image 265
toy Avatar asked Jan 29 '13 14:01

toy


People also ask

What is the difference between trunk and branch in SVN?

A trunk in SVN is main development area, where major development happens. A branch in SVN is sub development area where parallel development on different functionalities happens. After completion of a functionality, a branch is usually merged back into trunk.

What is trunk branches and tags in SVN?

A tag is just a marker. Trunk would be the main body of development, originating from the start of the project until the present. Branch will be a copy of code derived from a certain point in the trunk that is used for applying major changes to the code while preserving the integrity of the code in the trunk.


1 Answers

Edit: I misread the question and answered what I thought you were asking, not what you actually asked.

To clone just the trunk

Cloning a single Subversion directory is easy, and it actually doesn't matter which directory you clone. Just don't specify any of the "layout" arguments, and give the path to the trunk directly:

git svn clone http://path.to.svn.repo/module1/trunk 

To clone a specific module, including tags and branches and so forth

A "normal" git svn clone would look something like the following:

git svn clone --stdlayout http://path.to.svn.repo/ 

What you want to use instead will be thus:

git svn clone --stdlayout http://path.to.svn.repo/module1/ 

That will find the trunk, branch and tag subfolders of the module1 folder, and clone them for you.

like image 153
me_and Avatar answered Sep 22 '22 18:09

me_and