简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM