【发布时间】:2011-08-12 16:05:45
【问题描述】:
我正在尝试将现有的 git repo 推送到 svn。
here 和 here 描述了一些解决方案。 这就是我正在做的:
1.创建git repo:
$ mkdir /blabla/git_repo
$ cd /blabla/git_repo
$ git_init
$ touch hello.c
$ git add hello.c
$ git commit -m "init"
2.创建svn repo:
$ svnadmin create /blabla/svn_repo
$ cd /blabla/svn_repo
$ vim conf/*
... making initial configuring ...
$ svnserve --daemon --root /blabla/svn_repo/
所以,现在我有了纯 svn 存储库和现有的 git 存储库。
3.将git推入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 分支没有出现!
如果在第 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://localhost@1 1d926320-a80a-43d5-9e77-9dc2a43fc4f0
然后一切正常,除了我不能将 git 存储库推送到 GIT svn 项目中,我只能将它推送到 svn root。
那么,我做错了什么?
【问题讨论】: