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?
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”.
# 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 ...
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With