git樱桃选择一个承诺到另一个分支 [英] git cherry picking one commit to another branch
问题描述
因此,我正在考虑创建另一个分支用于本地使用提交,稍后将使用它。其中没有必要引用特定的票。
所以问题是,我如何在这个有用的项目分支中进行特定的提交,并将其应用到另一个科?对不起,如果我在这里使用的术语樱桃选择不正确。我使用sourcetree,但也可以使用命令行。
有几种方法可以实现它(您必须在你想应用提交的分支上),
你可以创建你想要的提交补丁然后应用它
git format-patch< commit sha1>
git apply< patch path>
或者您确实可以挑选您想要的提交
git cherry-pick< commit sha1>
In developing for a work enviornment, we create a branch for each feature or fix we work on, and then merge to QA for testing.
Occasionally I find it's helpful to have a stash which contains console.logs' of debugging steps for a specific process. But I want to only have that be a subset of files in my working copy.
So, I am considering creating another branch for local use with commits which will be used later. Which don't reference a specific ticket necessarily.
So the question is, how can I take a specific commit in this "useful items" branch, and apply it to another branch? I'm sorry if I'm using the term cherry pick incorrectly here. I use sourcetree but am able to use command line for this also.
there are several ways to achieve it (you have to be on the branch you want to apply the commit to),
you can create a patch of the commit you want then apply it
git format-patch <commit sha1>
git apply <patch path>
or you can indeed cherry-pick the commit you want
git cherry-pick <commit sha1>
这篇关于git樱桃选择一个承诺到另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!