Unable to determine upstream SVN information from HEAD history

后端 未结 11 951
忘掉有多难
忘掉有多难 2020-12-02 10:28

Why do I get this error message?

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 11:15

    I saw this after I used BFG Repo-Cleaner https://rtyley.github.io/bfg-repo-cleaner/ and rewrited git history (intentional), and then tried to git svn fetch again. The message shows that the git <-> svn matching is lost.

    To solves this, read https://git-scm.com/docs/git-svn
    At the very bottom shows:

    $GIT_DIR/svn/*/.rev_map.

    Mapping between Subversion revision numbers and Git commit names. In a repository where the noMetadata option is not set, this can be rebuilt from the git-svn-id: lines that are at the end of every commit (see the svn.noMetadata section above for details).

    You need to have the git-svn-id comments in the commit comments to do this. If you do, you can delete the .rev_map.* file and rebuild it.

    rm .git/svn/refs/remotes/git-svn/.rev_map.*
    git svn info
    

    This should show:

    Rebuilding .git/svn/refs/remotes/git-svn/.rev_map.{snip} ...
    ...
    Done rebuilding .git/svn/refs/remotes/git-svn/.rev_map.{snip}
    Path: .
    ...and then regular git svn info output
    

提交回复
热议问题