Alexander
Alexander

Reputation: 31

How do I convert my SVN repository to Git while preserving branches?

Some help please. This doesn't seem to do it for me:

git svn clone --stdlayout --authors-file=../authors.txt file:///home/path

Upvotes: 3

Views: 216

Answers (4)

rubo77
rubo77

Reputation: 20875

I would try to clone your SVN with SmartGit: it translates such SVN concepts like branches, tags, ignores, EOLs to the corresponding Git concepts.

Maybe I will find an easy Howto....

Upvotes: 0

csexton
csexton

Reputation: 24813

I have had great luck with specifying the branches and tags explicitly:

git svn clone http://server.com/svn/project -T trunk -b branches -t tags project
git remote add origin [email protected]:project
git push origin master

Upvotes: 0

ebneter
ebneter

Reputation: 21543

The simplest way is to use svn2git, a ruby script that handles all of that for you. I've used it over the past 8 months or so to convert several quite large subversion repos to git; it's by far the best tool I've found for the job.

Upvotes: 2

mipadi
mipadi

Reputation: 411192

There's a pretty thorough set of instructions available here, including how to convert SVN "tags" and "branches" into actual Git tags and branches.

Upvotes: 1

Related Questions