
我正在使用此將我的 SVN 儲存庫遷移到 Git (BitBucket)教學。但我沒有使用標準的 SVN 佈局,所以這似乎沒什麼問題。
我的 SVN 儲存庫是 Android 專案的簡單副本。
/svn/dirname/project/app
沒有trunk
、branches
和tags
子資料夾。你可以說它project
等於樹幹。
git svn clone --trunk=/project --authors-file=authors.txt https://host/svn/dirname project
Initialised empty Git repository in /home/osboxes/GitMigration/project/.git/
Checked out HEAD:
https://host/svn/dirname/project r300
下一步應該是清理,但失敗了。也許是因為我沒有任何分公司:
java -jar ~/svn-migration-scripts.jar clean-git
Could not retrieve the config for the key: svn-remote.svn.branches
但後來失敗了,我不知道該如何繼續
java -jar ~/svn-migration-scripts.jar sync-rebase
fatal: ambiguous argument 'remotes/trunk': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error finding tracking ref for branch master
答案1
在我看來是固定的。我做了什麼:
- 將 SVN 儲存庫重新排列為標準佈局
git svn clone --stdlayout --prefix='' --authors-file=authors.txt https://host/svn/dirname project
我發現了 2014 年的 attlassian 問題 #2,請求添加 Git 2.0 相容性。它有 22 票,但尚未解決。有一個使用該prefix
參數的提示。