SarekOfVulcan
SarekOfVulcan

Reputation: 1358

Import Subversion repository into Git

I have an existing SVN repository at http://svn.donnael.com/lilypond/SousaFairest. Out of curiosity, I created a repository at https://github.com/SarekOfVulcan/donnael-Scores as well, and added some files to it. Can I now take the Sousa folder and import that into the GitHub directory, maintaining the change history, or is that more trouble than it's worth? (I have a decent understanding of svn, but git is brand new to me.)

Upvotes: 2

Views: 1510

Answers (2)

Andy
Andy

Reputation: 46324

There are many tutorials online about importing subversion into git. As far as it being a hassle, it's only (3-4 commands). It's worth doing, unless you don't want to keep your svn repo's history.

Here's githubs guide to pulling it off

Upvotes: 2

Ryan Stewart
Ryan Stewart

Reputation: 128759

I believe that would be possible. There may be a way to do it all from one local repo, but I'm pretty confident that this would work. Assuming you're starting from scratch with no local repos:

  • git svn clone your SVN repo to a local git repo (hereafter known as svn-repo)
  • git clone your github repo to a local repo (known as github-repo)
  • In github-repo, git remote add svn-repo <url> using a local file URL
  • git fetch svn-repo
  • git merge svn-repo/master to merge the master branch of svn-repo into github-repo
  • Then just push to github

Upvotes: 4

Related Questions