【问题标题】:dcommit only a certain local (i.e. git) branch with git-svndcommit 仅使用 git-svn 的某个本地(即 git)分支
【发布时间】:2014-09-01 17:17:54
【问题描述】:

我正在使用git 进行开发,但我必须通过svn 发布。 这就是我设置git-svngit 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.filesvn 完全隐藏? 如果是这样,我想我可以将 git merge 转换为 mastergit svn dcommitsvn 它一旦得到'un-classified'。对吗?

另外,为了清楚起见,是否可以将master 重命名为public? 如果是这样,怎么做?请注意,两个存储库中已经有该分支的历史记录。

【问题讨论】:

    标签: git svn git-svn git-branch


    【解决方案1】:

    是的,您的秘密更改将保留在您的本地 git 中,直到您执行 git checkout secret && git svn dcommit 或将您的更改合并到其他分支 (master/public) 并从那里 dcommit。

    您可以简单地启动 public,而不是将 master 重命名为 public: git checkout master git checkout -b public git commit, etc... git svn dcommit 分支会“记住”它们开始的 svn 分支,您可以随时使用git svn info 进行检查。您可以选择在切换到公共后删除 master:git branch -D master

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-16
      • 2010-09-30
      • 2010-09-16
      • 2018-10-13
      • 2012-08-04
      • 1970-01-01
      • 2012-10-17
      相关资源
      最近更新 更多