Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to convert svn repository (without trunk) to git

Tags:

git

svn

git-svn

I'm trying to convert my svn repo to git, but I'm not having much success. The repository in question does not have anything like a "trunk". The layout is the following:

/home/svn/
      |--- /project1/
      |--- /project2/
      |--- /repos/project3/

And underneath those project folders are the files. No trunk, no branches, no nothing special. At the time that was all I needed, and now it's biting me in the ass.

I'm following this guide: http://john.albin.net/git/convert-subversion-to-git

When I run this command:

git svn clone svn+ssh://[email protected]/home/svn/repos/kiflea --no-metadata -A authors-transform.txt --stdlayout ~/kiflea

It says it has created an empty git repository... But I don't really want it to be empty.

I also have no idea what the following commands should look like, since my repository has a different layout.

Commands like git symbolic-ref HEAD refs/heads/trunk or git config remote.bare.push 'refs/remotes/*:refs/heads/*'

like image 596
skerit Avatar asked Jun 22 '12 15:06

skerit


People also ask

Can you convert SVN to Git?

We've broken down the SVN-to-Git migration process into 5 simple steps: Prepare your environment for the migration. Convert the SVN repository to a local Git repository. Synchronize the local Git repository when the SVN repository changes.

How you will migrate the projects from SVN to GitHub?

Prepare a migration environment. Convert the source SVN repository to a local Git repository. (Optional) Synchronize the local Git repository with any changes from SVN repository while developers continue using SVN. Push the local Git repository to a remote Git repository hosted on Azure Repos.

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

Does SVN support Git?

Git SVN is a feature in Git that allows changes to move between a Subversion and a Git repository. Git SVN is a good feature to use if you need to allow changes to go between Git and SVN repositories.


1 Answers

If you have local access to your SVN repository, I would recommend you to use SubGit for conversion. There're a few simple steps:

$ subgit configure path/to/svn/repository
$ #edit path/to/svn/repository/conf/subgit.conf to specify "core.authorsFile" option to point to your authors-transform.txt
$ subgit install path/to/svn/repository

After that a Git repository will be created and the repositories will be in constant sync. Optionally you may run

$ subgit uninstall path/to/svn/repository

to turn synchronization off.

If you have no local access to your repository, you clone your repository with SmartGit. The effect will similar to "git svn clone" but such SVN concepts like ignores, EOLs-processing options, tags will be also translated to Git (the same I can say about SubGit too).

None of those solutions is based on "git-svn".

like image 155
Dmitry Pavlenko Avatar answered Oct 05 '22 12:10

Dmitry Pavlenko