开发者

Cloning git repository from svn repository, results in file-less, remote-branch-less git repo

Working SVN repo

I'm starting a git repo to interact with a svn repo. The svn repository is set and working fine, with a single commit of a basic README file in it.

Checking it out works fine:

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

Failed git-svn clone of svn repo

When I try to clone the rep开发者_如何学Pythonository in git, the first step shows no errors...

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': 

...but results in a useless folder, containing no files, no branches, and no commits:

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'

How do I get something I can commit back to? I expect I'm doing something wrong in this process, but what?


You used the -s option to git svn clone, but from your example, it doesn't appear that your Subversion repository is using the standard layout (i.e., trunk, branches, and tags directories at the repository root).

If that's the case, clone without -s.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜