Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use git-svn clone to only get the HEAD revision from a Subversion repository?

Tags:

git

git-svn

How to use git svn clone to only get the HEAD revision from a Subversion repository?

I been trying

git svn clone -s http://svn/java/<projectname>

but I been getting a lot of empty directory and I tried everything. So know I would like to do a clone of just the head in subversion... Can this be done?

like image 318
techsjs2013 Avatar asked Feb 14 '13 13:02

techsjs2013


People also ask

Can SVN Git clone from an SVN repository?

Git installation comes with “git svn”. This will allow you to clone a SVN repository and provide a git interface over it. You can clone from a SVN repo using the git svn clone command. -s = If your SVN repo follows standard naming convention where main source is in “trunk”, branches are created in “branches”.

How do I clone a SVN repository?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...

What does Git svn clone do?

The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.

What is head revision and revision in SVN?

The HEAD revision refers to the most current revision in a repository. If you are browsing the HEAD revision of your repository and one of your teammates commits a change, those new changes will be included when you decide to check out a working copy of that revision or fetch specific information about it.


1 Answers

I think this is what you want:

git svn clone -s -r HEAD http://svn/java/<projectname>

You can also specify a range with -r 2039:HEAD if, for example, you want all the revisions from 2039 up to the latest. You might do this if it's really the history prior to 2039 that you object to, rather than everything prior to the current revision.

like image 168
chepner Avatar answered Oct 03 '22 23:10

chepner