42

工作 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'

我怎样才能得到我可以承诺的东西?我希望我在这个过程中做错了什么,但是什么?

4

1 回答 1

68

您使用了-sto 选项git svn clone,但从您的示例来看,您的 Subversion 存储库似乎没有使用标准布局(存储库根目录下的主干、分支和标记目录)。

如果是这种情况,请克隆不带-s.

于 2010-04-02T18:31:52.340 回答