Cherry从其他分支跳过空提交提交一组提交 [英] Cherry pick set of commits from other branch skipping empty commits

查看:577
本文介绍了Cherry从其他分支跳过空提交提交一组提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 cherry-pick

  git rev-list --reverse something-begin..something-end | git cherry-pick --stdin 

然后以错误信息结束

  ... 
您目前是樱桃采摘提交xxxyyy。

没有提交,工作树清理
以前的樱桃选项现在是空的,可能是由于解决冲突。
如果你想提交它,使用:

git commit --allow-empty

如果你想跳过这个提交,使用:

git reset

然后,git cherry-pick -continue将继续挑选其余的提交。

我不想选择这些空提交。

输入 git reset是非常烦人的; git cherry-pick - continueue 为每个停止和提示。



为什么没有提供 - skip-empty 选项?然后我得到这个线程:


http://markmail.org/message/yowzaetyu32ulvz7


这很糟糕,我检查了我的git版本 2.9.3 甚至找到 cherry-pick 不支持 - 跳过-empty - empty-commpit = skip 或任何其他。



I检查 git rev-list 有一个选项 - remove-empty 但它没有任何帮助。

解决方案

最后我找到了解决方案。 code> git rev-list --reverse something-begin..something-end。 | git cherry-pick --stdin

rev-list 命令(这是路径部分)将跳过所有空提交对我来说(什么是 - 删除空的??)


I am doing merge bunches of commits using cherry-pick

git rev-list --reverse something-begin..something-end | git cherry-pick --stdin

and then ends up with error message

...
You are currently cherry-picking commit xxxyyy.

nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

If you wish to skip this commit, use:

    git reset

Then "git cherry-pick --continue" will resume cherry-picking the remaining commits.

I dont want to pick any of these empty commits.

It is very annoying that entering git reset; git cherry-pick --continue for each stop and prompts.

why didn't it provide a --skip-empty option? And then I got to this thread:

http://markmail.org/message/yowzaetyu32ulvz7

It's so bad that I check my git version 2.9.3 and even found it cherry-pick do not supports either --skip-empty or --empty-commpit=skip or any other.

I had check that git rev-list has an option --remove-empty but it just did not work any help.

解决方案

Finally I found the solution.

git rev-list --reverse something-begin..something-end . | git cherry-pick --stdin

Adding a dot to rev-list command (that is the path parts) will skip all empty commits for me (what is --remove-empty for??)

这篇关于Cherry从其他分支跳过空提交提交一组提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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