git-svn dcommiting一个git提交 [英] git-svn dcommiting a single git commit

查看:100
本文介绍了git-svn dcommiting一个git提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定多个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>












$ b git 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆