2016-12-14 6 views
0

現在、標準レイアウトのsvnレポをクローンしています。現在のところ、1つのiOSアプリと1つのAndroidアプリに対応するコードが含まれています。タグは、コードをフリーズしてリリースしたときを示します。gitタグ:致命的:有効なレファレンスとして 'refs/remotes/my_tag_name'を解決できませんでした

私は(SVNサーバは、マシン上でローカルに実行)を使用してレポをクローン:

git svn clone --trunk=/trunk --tags=/tags --branches=/branches --authors-file=authors.txt http://localhost/svn/MY_PROJECT MY_PROJECT 

その後MY_PROJECT、今

git remote add origin ssh://[email protected]_bitbuket_repo.com:7999/test/MY_PROJECT.git 
git push -u origin master 

そして、問題の一部に。今私はタグをプッシュするwan't。

[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT (master) 
$ git branch -a 
* master 
    remotes/origin/master 
    remotes/tags/android_v1.4.2 
    remotes/tags/android_v1.5 
    remotes/tags/iOS-1.4.1 
    remotes/tags/iOS-1.5 
    remotes/tags/iOS_Android_1.3 
    remotes/tags/ios_v1.6 
    remotes/trunk 

だから私はon this useful page与えられたスクリプトを実行し、ここで私が得るものです:

[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT (master) 
$ sh convert_remotes_to_tags.sh 
fatal: Failed to resolve 'refs/remotes/android_v1.4.2' as a valid ref. 
fatal: Failed to resolve 'refs/remotes/android_v1.5' as a valid ref. 
fatal: Failed to resolve 'refs/remotes/iOS-1.4.1' as a valid ref. 
fatal: Failed to resolve 'refs/remotes/iOS-1.5' as a valid ref. 
fatal: Failed to resolve 'refs/remotes/iOS_Android_1.3' as a valid ref. 

だから私はon this particular answer与えられたものをテストした:

[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT (master) 
$ cd .git/svn/refs/remotes/tags/android_v1.4.2/ 

m[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT/.git/svn/refs/remotes/tags/android_v1.4.2 (GIT_DIR!) 
$ git config --bool core.bare true 

[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT (master) 
$ cd .git/svn/refs/remotes/tags/ 

[email protected]_MACHINE MINGW64 ~/workspace/svn2git/MY_PROJECT/.git/svn/refs/remotes/tags (BARE:master) 
$ git config --bool core.bare true 

これは...どちらか(同じ変換・タグ・スクリプトを実行している)

を動作しません私は、タグを移行する別のスクリプトをテストし、ここにある:

for tag in `git branch -r --sort=committerdate | grep "tags/" | sed 's/.*tags\///'`; do 
    git fetch --tags # must fetch tags before pushing more 
    git tag -a -m "Convert Subversion tag" $tag refs/remotes/origin/tags/$tag 
    git push origin $tag 
done 

しかし、これはと動作しません。よく、そのようなログを持つ:

fatal: Failed to resolve 'refs/remotes/origin/tags/android_v1.4.1' as a valid ref. 
error: src refspec android_v1.4.1 does not match any. 
error: failed to push some refs to 'ssh://[email protected]_bitbuket_repo.com:7999/df/my_project.git' 
fatal: Failed to resolve 'refs/remotes/origin/tags/iOS-1.4' as a valid ref. 
error: src refspec iOS-1.4 does not match any. 
error: failed to push some refs to 'ssh://[email protected]_bitbuket_repo.com:7999/df/my_project.git' 
fatal: Failed to resolve 'refs/remotes/origin/tags/android_v1.4.2' as a valid ref. 
error: src refspec android_v1.4.2 does not match any. 
error: failed to push some refs to 'ssh://[email protected]_bitbuket_repo.com:7999/df/my_project.git' 
fatal: Failed to resolve 'refs/remotes/origin/tags/iOS-1.4.1' as a valid ref. 
error: src refspec iOS-1.4.1 does not match any. 
error: failed to push some refs to 'ssh://[email protected]_bitbuket_repo.com:7999/df/my_project.git' 

あなたはこれらのタグを移行する方法についての手掛かりを持っていますか?

+0

これは1回限りの変換ですが、後でGitだけを使用しているのですか、GitクローンからSVNにコミットしたいのですか? – Vampire

+0

これは1回限りの変換です。私はBitbucketに行きたい、私はSVNに戻ってくるつもりはない。 –

+0

SmartGit http://www.syntevo.com/smartgit/を使用してリポジトリを移行し、タグを正しく収集しました。 –

答えて

1

git-svnではなく、レポジトリのワンタイムコンバージョンに適したツールです。 Gitを既存のSVNサーバーのフロントエンドとして使用したいのであれば、ではなくを使用してgit-svnを使用してください。svn2gitこれははるかにこのユースケースに適していて、適切なGitタグをSVNタグから削除します。

svn2gitというPlenyツールがありますが、おそらく最も良いのはhttps://github.com/svn-all-fast-export/svn2gitのKDEです。そのsvn2gitツールを使用することを強くお勧めします。それは私がそこで利用できると知っている最高です、そして、それはあなたがそのルールファイルでできることに非常に柔軟です。

svnevereverからhttp://blog.hartwork.org/?p=763までは、SVNリポジトリの履歴をGitに移行する際の履歴を調べるのに最適なツールです。git-svn(またはあなたのケースでは、間違ったsvn2gitが)で開始することが容易である


にもかかわらず代わりgit-svnのKDE svn2gitを使用して、なぜ、ここではさらにいくつかの理由があることは、その柔軟性以外にも、優れている:

  • 履歴はsvn2git(正確なものが使用されている場合)によってはるかに良く、よりきれいに再構築されますが、これは特に分岐やマージなどの複雑な履歴の場合に当てはまります
  • タグは、 Gothのチェス
  • git-svnタグには余分な空きコミットが含まれており、ブランチの一部ではないため、fetchはデフォルトでコマンドに--tagsを与えるまでそれらを取得しません。フェッチされる。彼らは
  • に属しどこ適切svn2gitタグを使用すると、SVNでレイアウトを変更した場合、あなたが簡単にあなたはまた、簡単に複数のGitリポジトリに1つのSVNリポジトリを分割することができsvn2gitと歴史最終的に
  • を失うことになるgit-svnで、svn2gitでこれを設定することができます
  • 又は容易1つのGitのリポジトリに同じSVNルートにおける複数のSVNリポジトリを組み合わせる
  • 変換が速く正確svn2gitgit-svn
0123よりも無数倍であります

git-svnが悪化し、KDE ​​svn2gitが優れている理由はたくさんあります。 :-)

+0

ありがとうございます@ヴァンパイア。 Linuxマシンが手元にある場合は、私はそれを使用します。現在、私はWindowsを持っているだけです... –

+0

だから何ですか?私はしばしば既にWindowsの下でそれを使用しました。 – Vampire

+0

しかし、qmake &&をWindowsマシンで直接実行するにはどうすればよいですか? –

関連する問題