複数svnレポジトリをgit-svnで使用する
今までdotfilesの類いをcodereposにコミットしていたのですが、codecheck.inにもコミットしたくなりました。でも複数svnレポジトリをトラックとかできんの?ということでとりあえずmanpageを見る事に。
man git-svn
- svn-remote
Specify the [svn-remote "
git-svn(1)"] section to use, this allows SVN multiple repositories to be tracked. Default: "svn"
という事が書いてあったので、できそうな気がします。
git-svn initしてみる
何も考えずにgit svn initしてみよう。
git svn init http://hogehoge.com/
git svn init http://fugafuga.com/ --svn-remote another-svn
この時点で .git/config を覗いてみる。
[svn-remote "svn"]
url = http://hogehoge.com/
fetch = :refs/remotes/git-svn[svn-remote "another-svn"]
url = http://fugafuga.com/
fetch = :refs/remotes/git-svn
2種類の設定ができている。でもfetchの部分がどちらもgit-svnなので、ちょっと問題あり?
git-configで設定を弄る
という訳でconfigファイルを設定する。直接変更した方が早い気もするけど、git-configを使ってみる。
git-config --unset svn-remote.another-svn.fetch git-config --add svn-remote.another-svn.fetch :refs/remotes/another-svn
この時点で .git/config を覗いてみる。
[svn-remote "svn"]
url = http://hogehoge.com/
fetch = :refs/remotes/git-svn[svn-remote "another-svn"]
url = http://fugafuga.com/
fetch = :refs/remotes/another-svn
これで良さげ?