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

后端 未结 2 2042
没有蜡笔的小新
没有蜡笔的小新 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:32

    I've done the following which appears to have worked.

    In .git/config I updated the fetch, branches and tags settings to update the local refs. It was:

    [svn-remote "svn"]
            url = http://subversion/......
            fetch = trunk:refs/remotes/Project/trunk
            branches = branches/*:refs/remotes/Project/*
            tags = tags/*:refs/remotes/Project/tags/*
    

    Which I changed to

    [svn-remote "svn"]
            url = http://subversion/......
            fetch = trunk:refs/remotes/trunk
            branches = branches/*:refs/remotes/svn/*
            tags = tags/*:refs/remotes/svn/tags/*
    

    The within .git/refs/remotes I moved trunk out of the Project folder and the remaining refs within Project into a new folder called svn. The structure was:

    • remotes
      • Project
        • trunk
        • feature-branch

    Which I changed to:

    • remotes
      • trunk
      • svn
        • feature-branch

    I also performed the same restructuring of folders within .git/svn/refs/remotes/.

    Finally I triggered a git svn fetch. I had to specify the -r argument to limit to the same start revision that I used for my initial clone, but it doesn't appear to have re-fetched the old revisions.

提交回复
热议问题