代码之家  ›  专栏  ›  技术社区  ›  Kzqai

从SVN存储库克隆git存储库,结果是无文件、无远程分支的git repo

  •  42
  • Kzqai  · 技术社区  · 15 年前

    工作SVN报告

    我正在启动Git回购,以与SVN回购进行交互。SVN存储库已经设置好并且工作正常,其中只提交了一个基本的自述文件。

    检查一下很好:

    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 回复  |  直到 11 年前
        1
  •  67
  •   Greg Bacon    15 年前

    你用过 -s 选择权 git svn clone 但从示例中看,您的Subversion存储库似乎没有使用标准布局。( ,trunk、branches和tags目录位于存储库根目录)。

    如果是这样,克隆没有 -S .