How can I change the Prefix Mapping in a Git-Svn Repository?

后端 未结 2 2040
没有蜡笔的小新
没有蜡笔的小新 2021-02-08 12:00

I\'ve created a Git Clone of a SVN repository using git-svn. When doing this I specified the --prefix option to prefix my remote branches. I now want to get rid of

2条回答
  •  误落风尘
    2021-02-08 12:44

    Note: the current solution might not work anymore with git 2.0+ (April 2014)

    See commit fe191fc by Johan Herland (jherland), which highlight the fact you now are supposed to have a prefix (and not have a svn branch without prefix like 'trunk'):

    Git 2.0: git svn: Set default --prefix='origin/' if --prefix is not given

    Having no prefix by default was problematic:

    git-svn by default puts its Subversion-tracking refs directly in refs/remotes/*.
    This runs counter to Git's convention of using refs/remotes/$remote/* for storing remote-tracking branches.

    Furthermore, combining git-svn with regular git remotes run the risk of clobbering refs under refs/remotes (e.g. if you have a git remote called "tags" with a "v1" branch, it will overlap with the git-svn's tracking branch for the "v1" tag from Subversion.

提交回复
热议问题