svn repoから作成されたgit repoがあります。最後のn個のコミットをsvnからgit repoに移動
しかし、git repoが作成された後、いくつかのものがsvnにコミットされました。
svnリビジョンごとにパッチを作成してgitにインポートすることはできますが、それは時間がかかります。
最後のn個のコミットをsvnからgitに移動する最も簡単な方法は何ですか?
svn repoから作成されたgit repoがあります。最後のn個のコミットをsvnからgit repoに移動
しかし、git repoが作成された後、いくつかのものがsvnにコミットされました。
svnリビジョンごとにパッチを作成してgitにインポートすることはできますが、それは時間がかかります。
最後のn個のコミットをsvnからgitに移動する最も簡単な方法は何ですか?
Gitリポジトリはgit svn
を使用して変換されましたか?
「はい」の場合は、git svn fetch
とそれに続くマージが必要です。
もしそうでなければ、git svn
を使ってSubversionリポジトリ全体を新しいものに変換し、結果のリポジトリから既存のGitリポジトリに必要なブランチを取り出し、対応するブランチへのコミットの必要な範囲をgit cherry-pick
にします。
$ git svn init <project url> --trunk=<path to trunk> local_repo
$ cd local_repo
$ git svn fetch --revision=X:HEAD # where X - last revision, that was already imported to git
$ cd ../your_actual_repo
$ git remote add tmp ../local_repo
$ git fetch --all
$ # cherry pick or rebase commits, that you want
# from remotes/tmp/master to master, you probably
# want to fix them afterwards with git rebase --interactive
$ git remote remove tmp