Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import a svn repo to git from a given point in time

Tags:

git

svn

git-svn

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.

like image 218
scetoaux Avatar asked May 04 '10 11:05

scetoaux


People also ask

Can I use Git and SVN at the same time?

No interaction between them. Just ignore the . git folder for SVN and the . svn folder for Git and you should be fine.

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 ...

Which popular tool can be used to migrate SVN to Git?

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.

How do I move a SVN repository to GitKraken?

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.

How do I import an SVN file into a GitHub repository?

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.

How to convert a Subversion repository to Git?

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. ...

How to migrate from SVN to Azure Repos?

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:


Video Answer


1 Answers

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.

like image 59
VonC Avatar answered Oct 29 '22 08:10

VonC