git svn ambiguous argument 'HEAD'
$ git svn clone -s http://a_repo local_dir ( by default this brings me r1 ) to hdd
Initialized empty Git repository in d:/Temp/local_dir/.git/
r1 = some_SHA (refs/remotes/trunk)
$ cd local_dir
$ git svn rebase
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
log --no-color --no-decorate --first-parent --pretty=medium HEAD: command returned error: 128
How can I actually checkout the repo?
I also tried without rebasing, to use fetch
, but it only brings one r开发者_如何学编程evision at a time. We have several thousand commits, at this rate, it will take days to copy the repository.
If you get only one commit out of your SVN repo, I assume that the SVN repo is not in standard layout but you tell git svn
that it is.
git svn clone http://a_repo local_dir
(i.e. without the -s
flag) should be able to clone the SVN repo. If this works, retry the clone and specify your trunk, tags and branches directories as described in the docs of git-svn.
git svn clone [your-repo-url] -s
# OR
git svn clone [your-repo-url] -T [your-trunk-dir] -t [your-tags-dir] -b [your-branches-dir]
If you don't specify -r flag (as above), then you need to
git svn fetch
This error occurs when you clone a branch instead of the whole SVN repository.
If your repo URL looks like https://svnserver/project/repo/trunk
or https://svnserver/project/branches/pre-something
, change the clone command to:
git svn clone https://svnserver/project/repo --stdlayout
精彩评论