What can I do to import a SVN repository into git but only from a (known) revision number and onwards?
I've tried with:
git svn clone --authors-file=/home/ubuntu/svn-git-users.lst --revision=4151 -T trunk -b branch -t tags file://`pwd`/../svn-server-sync/MyRepo MyRepo
But it fails with:
r4151 = e80c7c5923700d6c7594c91f172779af63a8511b (refs/remotes/snapshots) fatal: refs/remotes/trunk: not a valid SHA1
Can someone help me with this?
Thanks in advance.
No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.
# 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 ...
There are many tools such as svn2git available to perform the migration, in this tutorial we will focus on git-svn utility: a Git extension , which can be used to check out a Subversion repository to a local Git repository and then push changes from the local Git repository back to the Subversion repository.
That command will clone the SVN repository to a new Git repository in the “temp” folder of your repo directory. If you open the repo in GitKraken, you will see that the commits are now in the Git format. Next, you will want to address the svn:ignore file, if you were using one.
GitHub will import an SVN repo quite easily when you create a new repo (you just specify import code after you create it). You get a progress bar (which isn't clear when you use git-svn clone). It has a fancy author-matching interface, and I'm guessing it's more robust with tags than this manual way.
Converting a Subversion repository to Git (7 steps to migrate a complete mirror of svn in git) 1. Retrieve a list of all Subversion committers. Subversion simply lists the username for each commit. Git’s commits have much richer data, but at its ... 2. Clone the Subversion repository using git-svn. ...
Lock SVN repository, synchronize any remaining changes from SVN repository to local Git repository and push final changes to the remote Git repository on Azure Repos Configure a migration environment on a local workstation and install the following software:
To follow up on my comment, it seems it might be a syntax issue:
-r4151,
instead of -r=4151
(no 'equal' sign needed).
The question How to git-svn clone the last n revisions from a Subversion repository? provides some good examples.
The OP reports trying -r4151:HEAD
, which for now is importing the SVN repo.
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