【问题标题】:Retaining topic branch commits with git-svn dcommit使用 git-svn dcommit 保留主题分支提交
【发布时间】:2011-04-15 06:52:39
【问题描述】:

我最近开始使用 git-svn。我的 git 工作流程是这样的。
git 结帐大师
git svn rebase
git checkout -b 主题分支
..变化
混帐提交
git 结帐大师
git 合并主题分支
git svn rebase
git dcommit

问题是,每当我执行 dcommit 时,主题分支的唯一最终合并提交都会在 svn 存储库中看到。我想查看 svn 提交对应于主题分支中的单个 git 提交。

他们有什么办法吗。或者这是推荐的默认行为。

【问题讨论】:

  • 你的最终命令应该是git svn dcommit?

标签: git git-svn


【解决方案1】:

(没有附加参数的git rebase 是一个错误,所以我怀疑你没有准确地描述你在做什么。另外,你错过了git svn dcommit 中的svn。)

但是,在我看来,问题在于您将topicbranch 合并到master 中而没有先对其进行变基。这意味着如果这不是一个快进合并,将会在 git 历史记录中添加一个合并提交,而这只能由 Subversion 中的单个提交表示。处理完主题分支后,请尝试以下操作:

# make sure you're on the right branch first:
git checkout topicbranch 
git rebase master
git checkout master
git merge topicbranch
git svn rebase
git svn dcommit

【讨论】:

  • 这会将提交压缩成一个 svn 吗?或者那是获得它的正确方法吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-09-01
  • 2010-10-12
  • 1970-01-01
  • 2010-09-30
  • 1970-01-01
  • 2015-04-17
  • 2010-11-22
相关资源
最近更新 更多