Git樱桃 - 从文件中选择一批提交 [英] Git cherry-Pick a batch of commits from a file

查看:106
本文介绍了Git樱桃 - 从文件中选择一批提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从主分支中挑选一批提交并将它们放入他们自己的分支中。我有一个文件(称为output.txt)中的所有提交散列,并且我试图将其传递给git cherry-pick。这里是我想出的命令:



tail -r〜/ outfile.txt | git cherry-pick -n --stdin



但是,如果发生合并冲突,那么该字符串会失败,我宁愿让某个事件在我遇到合并冲突时挂起,所以我可以修复它,并继续沿着



任何想法吗? 建筑物根据knittl的回答:

  while read line;做
git cherry-pick -n$ line||退出1
完成< outfile.txt


I'm attempting to cherry-pick a batch of commits from my master branch and get them into their own branch. I have all my commit hashes in a file (called output.txt) and i'm attempting to pipe this to git cherry-pick. Here is the command i came up with:

tail -r ~/outfile.txt | git cherry-pick -n --stdin

yet this string fails if there is a merge conflict, i would rather have something that hangs when i hit a merge conflict so i can fix it and continue along

any ideas?

解决方案

Building upon knittl's answer:

while read line; do
    git cherry-pick -n "$line" || exit 1
done < outfile.txt

这篇关于Git樱桃 - 从文件中选择一批提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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