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

陌路散爱 提交于 2019-12-21 04:18:27

问题


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 use --stdlayout since it takes a long time to download and I already have most of the code locally. How do I change the repository layout to match svn trunk/branches/tags scheme without having to clone again?


回答1:


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.



来源:https://stackoverflow.com/questions/1582392/start-tracking-branches-tags-on-a-git-svn-repo-that-was-tracking-only-trunk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!