2010-06-09 181 views
28

我想使用svn2git從svn導入我的倉庫到git,但它似乎失敗了,當它擊中一個分支。有什麼問題?這個svn2git錯誤是什麼意思?

Found possible branch point: https://s.aaa.com/repo/trunk/project => https://s.aaa.com/repo/branches/project-beta1.0, 128 
Use of uninitialized value in substitution (s///) at /opt/local/libexec/git-core/git-svn line 1728. 
Use of uninitialized value in concatenation (.) or string at /opt/local/libexec/git-core/git-svn line 1728. 
refs/remotes/trunk: 'https://s.aaa.com/repo' not found in '' 

Running command: git branch -l --no-color 
* master 
Running command: git branch -r --no-color 
    trunk 
Running command: git checkout trunk 
Note: checking out 'trunk'. 

You are in 'detached HEAD' state. You can look around, make experimental 
changes and commit them, and you can discard any commits you make in this 
state without impacting any branches by performing another checkout. 

If you want to create a new branch to retain commits you create, you may 
do so (now or later) by using -b with the checkout command again. Example: 

    git checkout -b new_branch_name 

HEAD is now at f4e6268... Changing svn repository in cap files 
Running command: git branch -D master 
Deleted branch master (was f4e6268). 
Running command: git checkout -f -b master 
Switched to a new branch 'master' 
Running command: git gc 
Counting objects: 450, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (368/368), done. 
Writing objects: 100% (450/450), done. 
Total 450 (delta 63), reused 450 (delta 63) 
+0

我有我svn和git的問題。我沒有ideea你的問題可能是什麼,但也許你可以嘗試一個不同的存儲庫轉換工具,如裁縫例如:http://progetti.arstecnica.it /裁縫/ ? – Unknown 2010-06-09 20:42:02

+0

非常相似/相同的錯誤到這個職位: http://stackoverflow.com/questions/15387812/git-svn-found-possible-branch-point/ – 2016-05-05 10:30:43

回答

4

您的Subversion版本庫沒有標準的trunk/branches/tags結構。使用--branch,--tag,--trunk選項指定分支位置的備用位置。

+0

我有同樣的問題,並通過這樣做解決它。 – Pacu 2012-06-29 21:45:11

58

我不得不打開.git/config文件,並刪除svn-remote部分下的所有分支和標記條目,然後運行'git svn clone'命令使此錯誤消失。顯然,如果我多次運行此命令(通常是停止並從修訂版重新啓動),分支/標記條目將被添加到配置文件中,而不是被重用,這會導致錯誤。

+1

謝謝,我刪除了[svn-remote「svn」]部分下的所有內容。這對我有效.. – kpasgma 2011-06-30 20:04:47

+0

耶!工作! – 2011-10-08 12:33:23

+9

我並不需要刪除所有內容,只需重複以下行:'branches = branches/*:refs/remotes/svn/*'和'tags = tags/*:refs/remotes/svn/tags/*'(keep一個) – 2012-11-28 04:22:15

4

要解決您的問題,您必須將導入的遠程分支和標籤轉換爲本地分支。 原文鏈接::http://progit.org/book/ch8-2.html

斯科特Chacone(PRO GIT)第

​​3210

這個工作對我來說十分合適。

+0

爲我工作...... !!!!但就我而言,我只需對「遙控器」進行更改,因爲標籤在失敗時根本不存在。 – 2013-12-16 05:25:54

+0

再次損壞後,我剛剛刪除了.git/config文件中「remote svn」塊中的所有條目,它工作正常! – 2013-12-16 05:42:09

5

當我遇到同樣的錯誤信息時,我正在跟着一些svn到git instructions。當我跑這個命令時發生錯誤:

git svn clone file:///pathto/repo /pathto/new-git-repo –-no-metadata -A authors.txt -t tags -b branches -T trunk 

發生錯誤後,我編輯的.git /配置文件如下:

tags = tags/*:refs/remotes/svn/tags/* 
branches = branches/*:refs/remotes/svn/* 

- >

tags = tags/*:refs/remotes/svn/tags/* 
branches = branches/*:refs/remotes/svn/branches/* 

即,我只是將「braches」行格式化爲與「tags」行類似。 然後我再次運行命令。這個過程產生了一個有效的git與遠程分支的回購。

+0

這是一個問題嗎?一個答案?或者只是'爲了我們的信息'? – Manuel 2013-07-24 07:30:01

+0

這是一種通過錯誤(在我的情況下崩潰的過程)並從svn克隆到git完成的一種方法。 – jaolho 2013-07-24 11:30:15

2

看來svn2git沒有正確傳遞分支配置。我有標準的佈局,但發生錯誤。我通過再次傳遞默認值來修復它:

$ svn2git http://repos --branches branches --tags tags --trunk trunk 

然後它按預期工作。