从svn存储库克隆git存储库,导致无文件,远程无分支的git repo

时间:2010-04-02 18:10:21

标签: git repository git-svn git-clone

使用SVN回购

我正在开始使用git repo与svn repo进行交互。 svn存储库已设置并正常工作,只需提交一个基本的README文件即可。

检查出来工作正常:

tchalvak:~/test/svn-test$ 
svn checkout --username=myUsernameHere http://www.url.to/project/here/charityweb/
A    charityweb/README
Checked out revision 1.

svn repo

的git-svn克隆失败

当我尝试在git中克隆存储库时,第一步显示没有错误......

tchalvak:~/test$ 
git svn clone -s --username=myUserNameHere http://www.url.to/project/here/charityweb/
Initialized empty Git repository in /home/tchalvak/test/charityweb/.git/
Authentication realm: <http://www.url.to/project/here:80> Charity Web
Password for 'myUserNameHere': 

...但是会产生一个无用的文件夹,不包含文件,没有分支,也没有提交:

tchalvak:~/test$ ls
charityweb
tchalvak:~/test$ cd charityweb/
tchalvak:~/test/charityweb$ ls
tchalvak:~/test/charityweb$ ls -al
total 12
drwxr-xr-x 3 tchalvak tchalvak 4096 2010-04-02 13:46 .
drwxr-xr-x 4 tchalvak tchalvak 4096 2010-04-02 13:46 ..
drwxr-xr-x 8 tchalvak tchalvak 4096 2010-04-02 13:47 .git
tchalvak:~/test/charityweb$ git branch -av
tchalvak:~/test/charityweb$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
tchalvak:~/test/charityweb$ git fetch
fatal: Where do you want to fetch from today?
tchalvak:~/test/charityweb$ git rebase origin/master
fatal: bad revision 'HEAD'
fatal: Needed a single revision
invalid upstream origin/master
tchalvak:~/test/charityweb$ git log
fatal: bad default revision 'HEAD'

如何获得我可以回复的内容?我希望我在这个过程中做错了什么,但是什么?

1 个答案:

答案 0 :(得分:67)

您使用-s选项git svn clone,但是从您的示例中,您的Subversion存储库似乎没有使用标准布局(,trunk,分支,并在存储库根目录标记目录。

如果是这种情况,请在没有-s的情况下克隆。

相关问题