git-svn dcommiting一个git提交 [英] git-svn dcommiting a single git commit
问题描述
给定多个unpushed git
提交,是否有可能只有一个提交 git-svn dcommit
?
例如我犯了foo,bar和baz,但是现在我只想在svn回购中有最终结果。这可能吗?
我有一种硬壳的答案。你可以创建一个新的分支,其中包含out foo,bar和baz,然后将 cherry-pick
bar添加到新分支,然后添加 git-svn dcommit
该分支并在完成后将其删除。这看起来不是很优雅。
假设foo,bar和baz在分支x中,而master没有任何分支。
git branch y master
git checkout y
git cherry-pick< sha1 bar>
$ bgit checkout x
git svn rebase
git branch -dy
<如果主人确实有这些提交,你可以按照Sizzler的建议重新设置。
Given multiple unpushed git
commits, is it possible to git-svn dcommit
only one of those commits?
e.g. I have commit foo, bar, and baz, but right now I only want to have bar end up in the svn repo. Is this possible?
I have one sort of crusty answer. You can create a new branch with out foo, bar, and baz in it and then cherry-pick
bar to the new branch and then git-svn dcommit
that branch and remove it when you're done. That doesn't seem very elegant though.
So assuming foo, bar, and baz are in branch x and master doesn't have any of them.
git branch y master
git checkout y
git cherry-pick <sha1 of bar>
git svn dcommit
git checkout x
git svn rebase
git branch -d y
If master does have these commits you can reset the head as Sizzler suggests.
这篇关于git-svn dcommiting一个git提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!