2011-08-11 60 views
2

我試圖將現有的git repo推入svn。使用git-svn從git推送到顛覆的麻煩

有解決方案herehere。 這就是我在做什麼:

1.Creating混帳回購協議:

$ mkdir /blabla/git_repo 
$ cd /blabla/git_repo 
$ git_init 
$ touch hello.c 
$ git add hello.c 
$ git commit -m "init" 

2.創建SVN回購:

$ svnadmin create /blabla/svn_repo 
$ cd /blabla/svn_repo 
$ vim conf/* 
... making initial configuring ... 
$ svnserve --daemon --root /blabla/svn_repo/ 

所以,現在我有純SVN倉庫和現有的Git倉庫。

3.Pushing混帳到SVN

$ cd /blabla/git_repo 
$ svn mkdir --parents svn://localhost/GIT/trunk -m "git import" 
$ git svn init svn://localhost -T GIT/trunk 
$ git svn fetch 
Error from SVN, (220001): Item is not readable: Item is not readable 
$ git branch -av 
* master 54ab8bf init 

所以,SVN分支不apperaing!

如果在第3步中我嘗試這樣做:

$ cd /blabla/git_repo 
$ svn mkdir --parents svn://localhost/GIT/trunk -m "git import" 
$ git svn init svn://localhost   <-- **no "-T" flag here** 
$ git svn fetch 
Authentication realm: <svn://localhost:3690> 1d926320-a80a-43d5-9e77-9dc2a43fc4f0 
Password for 'arsen': 
W: +empty_dir: GIT/trunk 
r1 = 8d3e31cf67f29846660ef20faf3454005101e012 (refs/remotes/git-svn) 
$ git branch -av 
* master   18cbfbd init 
    remotes/git-svn 8d3e31c git-svn-id: svn://[email protected] 1d926320-a80a-43d5-9e77-9dc2a43fc4f0 

那麼一切都OK,但我不能把git倉庫到GIT SVN項目,我可以把它僅僅爲SVN根。

那麼,我做錯了什麼?

回答

0

把東西放在你的SVN樹中,然後再試一次。 (你可以通過dump/load在svn中刪除它)

+0

我已經添加並提交這些文件到SVN:/ GIT/trunk/1,/ GIT/2,/ 3。我刪除並再次創建git存儲庫。同樣的故事。 – Grungegurunge

2

我發現了這個問題。

儘管svnserve.conf中有「anon-access = read」字符串,但我必須手動將「* = r」添加到svn authz文件中。現在它起作用了,雖然對我來說沒有意義。