LoginSignup
39
38

More than 5 years have passed since last update.

SubversionのリポジトリをGitのbareリポジトリとして移行する

Posted at

SubversionのリポジトリをGitのbareリポジトリとして移行したい場合は、このようにするとできるようです。

git init --bare --shared=true foo.git
cd foo.git
git --bare svn init -s file:///path/to/svn/repo
git --bare svn fetch

--shared-s|--stdlayoutは状況に合わせて。

実際にやってみた例:

$ git init --bare --shared=true foo.git
Initialized empty shared Git repository in /path/to/foo.git/

$ cd foo.git
$ git --bare svn init file:///path/to/svn/foo

$ git --bare svn fetch
        A       test.txt
r1 = b4e77596a114e2bbf8ad2d137e32f4a4778ee8cd (refs/remotes/git-svn)
        M       test.txt
r2 = 2be192a6a6c50f24aab03a99e7087c174898fe81 (refs/remotes/git-svn)
        M       test.txt
r3 = c54ca3c61befaec9ba16cf177c082ca7502dbe89 (refs/remotes/git-svn)

initsvn initsvn fetchの三段階でやらないとだめみたいで、git --bare svn clone ...はうまくいきませんでした。

git svn cloneで手元に持ってくるのはよくありますが、最初からbareリポジトリとして移行する方法があまり見当たらなかったので書いてみました。

39
38
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
39
38