CodeReposをありがたく使わせてもらっているけど、githubにも同じコードを置きたい、ということがよくありますよね。あるんです。以下はそのときのためのメモ。
プロジェクトを始めるとき
- CodeReposにファイルやディレクトリ一式 (X) をつくってcommit
- githubにレポジトリをつくる。(自分用のclone URL を Yとする)
- git svn clone で CodeReposにつくった一式 (X) をcheckout
- checkoutしたディレクトリで、git remote add github Y
- git remote push github
この手順でやればOK。 先にCodeReposでcommitしておいてからgit svnでcheckoutというところがミソなのかなと。
例
refe2-vim というプロジェクトをはじめることを考えます。
- mkdir $CODEREPOS/lang/vim/refe2-vim (X)
- create new github repository → http://github.com/mootoh/refe2-vim/ (Y: git@github.com:mootoh/refe2-vim.git)
- git svn clone http://svn.coderepos.org/share/lang/vim/refe2-vim
- cd refe2-vim
- git remote push github
だいたいこんなかんじ。
日々commitするとき
- ローカルに commit
- CodeReposにcommit (git svn dcommit)
- github にpush (git remote push github)
でOK。
ToDo: Mercurialも混ぜてみる
日本語