2017-09-01 165 views
0

我需要一個客戶從SVN遷移到Git,所以我想先嚐試在公共SVN倉庫svn2git。不能svn2git公共回購

我發現一些公共的回購協議,例如,https://svn.alfresco.com/repos/alfresco-open-mirror/alfrescohttp://svn.apache.org/repos/asf/spamassassin。有沒有做svn co的問題,但是當我嘗試svn2git,我得到了以下問題:

D:\Documents\work\svn2git\apache>svn2git http://svn.apache.org/repos/asf/spamassassin Initialized empty Git repository in D:/Documents/work/svn2git/apache/.git/ Using higher level of URL: http://svn.apache.org/repos/asf/spamassassin => http://svn.apache.org/repos/asf W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: REPORT request failed on '/repos/asf/!svn/bc/100': File not found: revision 100, path '/spamassassin' W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r100 Checked through r200 Checked through r300

它跑了整整一夜,並與結束:

Checked through r22000 Checked through r22100 W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r477700 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r477601 .. r477700 committed before the deletion r477601 .. r477679 OK Checked through r748600 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r748501 .. r748600 committed before the deletion Checked through r748700 Checked through r748800 Checked through r748900 Checked through r749000 Checked through r749100 Checked through r749200 Checked through r749300 Checked through r749400 W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org) W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories Checked through r805700 Path 'spamassassin' was probably deleted: RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org) Will attempt to follow revisions r805601 .. r805700 committed before the deletion Checked through r805800 Checked through r805900 Checked through r806000 Checked through r806100 Checked through r806200 Checked through r806300 Checked through r806400 Checked through r806500 Checked through r806600 Checked through r806700 command failed: git checkout -f master

爲什麼它發生了嗎?這是一個權限問題嗎?

回答

0

咳,到目前爲止一切正常。如果失敗,則應指定失敗的消息。

但除此之外,對於一次性遷移git-svn(您使用svn2git工具基於git-svn)是的倉庫或儲存庫的部分轉換的工具。這是一個偉大的工具,如果你想使用Git的作爲前端爲現有的SVN服務器,但對於一次性轉換,你應該使用git-svn或基於它的工具,但svn2git這是更適合這個用例。

有很多工具叫svn2git,可能最好的一個是從https://github.com/svn-all-fast-export/svn2git的KDE。我強烈建議使用svn2git工具。這是我所知道的最好的,並且它對你的規則文件可以做的非常靈活。這是基於git-svnsvn2git大部分來自相同的缺點比PUR git-svn受苦,只是周圍的一些問題的工作。

您將能夠輕鬆地配置svn2git統治文件來生成您從當前SVN佈局,包括任何可能存在的複雜的歷史要的結果,其中包括產生一些混帳回購了一個SVN回購或結合不同的SVN回購協議如果你喜歡,可以在一次運行中清理成一個Git倉庫。

如果您不是100%關於存儲庫的歷史記錄,svneverever from http://blog.hartwork.org/?p=763是一個很好的工具,用於在將SVN存儲庫遷移到Git時調查SVN存儲庫的歷史。


即使git-svn比較容易下手,這裏是爲什麼使用KDE svn2git代替git-svn優越,除了它的靈活性,一些深層次原因:

  • 歷史重建更好的和更清潔通過svn2git(如果使用正確的),這是更復雜的分支和合並的歷史尤其如此
  • 標籤是真正的標籤,而不是Git分支
  • git-svn標籤包含一個額外的空提交這也使得分支機構他們不要的部分,所以直到你給--tags的命令,默認情況下只標記指向獲取分支還端來一正常fetch不會得到他們。有了正確的svn2git標籤是屬於他們的地方
  • ,如果你在SVN改變佈局,可以輕鬆地與svn2git配置此,與git-svn你將失去​​歷史最終
  • svn2git你也可以拆分一個SVN倉庫分成多個Git倉庫容易
  • 或結合在相同的SVN根多個SVN儲存庫到一個Git倉庫容易
  • 轉換是用正確的svn2git速度比與極大數倍git-svn

你看,爲什麼git-svn更糟,KDE svn2git更好。 :-)