Start tracking branches/tags on a git-svn repo that was tracking only trunk

前端 未结 1 1583
甜味超标
甜味超标 2021-02-15 16:15

I\'ve started tracking an svn repository with git by cloning only its trunk directory. Now I want to track the other stuff, but I don\'t want to have to clone it again just to u

1条回答
  •  孤城傲影
    2021-02-15 17:10

    Old .git/config:

    [svn-remote "svn"]
            url = svn://host/project/trunk
            fetch = :refs/remotes/git-svn
    

    New .git/config:

    [svn-remote "svn"]
            url = svn://host/project
            fetch = trunk:refs/remotes/git-svn
            branches = branches/*:refs/remotes/*
            tags = tags/*:refs/remotes/tags/*
    

    Now run git svn reset -r1 -p; git svn fetch; git svn rebase.

    No, it's not much different from doing a git svn clone anew -- adding branches means that git can see more merges which means the content git is tracking has changed so git-svn must regenerate everything.

    0 讨论(0)
提交回复
热议问题