【发布时间】:2014-09-01 17:17:54
【问题描述】:
我正在使用git 进行开发,但我必须通过svn 发布。
这就是我设置git-svn(git svn clone)的原因。
我平时的工作流程是这样的:
git svn rebase # get local git repository up-to-date
git add file # add some code
git commit # commit code to local git repository
git svn dcommit # push changes from local git repository to public svn repository
到目前为止,这工作正常。
但是,我想在我的本地 git 存储库中创建一个分支(例如 secret),它被 git-svn 完全忽略。
我想我必须这样做:
git svn rebase # get local git repository up-to-date
git branch secret # create secret branch in local git repository
git checkout secret # switch to secret branch in local git repository
git add secret.file # add some secret code
git commit # commit secret code to secret branch of local git repository
git checkout master # switch back to public branch in local git repository
git svn rebase # get public branch of local git repository up-to-date
git add public.file # add some public code
git commit # commit public code to public branch of local git repository
git svn dcommit # push public changes from local git repository to public svn repository
这个工作流程是否会让secret.file 对svn 完全隐藏?
如果是这样,我想我可以将 git merge 转换为 master 和 git svn dcommit 到 svn 它一旦得到'un-classified'。对吗?
另外,为了清楚起见,是否可以将master 重命名为public?
如果是这样,怎么做?请注意,两个存储库中已经有该分支的历史记录。
【问题讨论】:
标签: git svn git-svn git-branch