

git cherry-pick
source link: https://forrestsu.github.io/posts/git/git-cherry-pick/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

git cherry-pick
2016年9月12日1 cherry-pick
git cherry-pick可以选择某一个分支中的一个或几个commit(s)来进行操作。 例如,假设我们有个稳定版本的分支,叫v2.0,另外还有个开发版本的分支v3.0,我们不能直接把两个分支合并,这样会导致稳定版本混乱,但是又想增加一个v3.0中的功能到v2.0中,这里就可以使用cherry-pick了。 如下图,比如我们想将master的C5修改记录,也提交到dev-feature这个分支上,我们可以使用:
git cherry-pick ee99d9a
如果没有修改文件的同一行则提交顺利。如果有冲突则需要手工解决。
2 冲突解决
如下图,我们进行cherry-pick发生了冲突。git 提示我们先手工修复,然后git add [patchs],最后git commit 即可。 通过git status 可以选择终止cherry-pick 或者继续。
解决完冲突后:
《全文完》
Recommend
-
10
对于多分支的代码库,将代码从一个分支转移到另一个分支是常见需求。 这时分两种情况。一种情况是,你需要另一个分支的所有代码变动,那么就采用合并( git merge )。另一种情况是,你只需要部分代码变动(某几个...
-
36
How to use git cherry-pick effectively Useful tricks of git cherry-pick
-
10
git cherry-pick的使用 2021年1月3日 / 1次阅读Git git cherry-pick是一个浪漫的名称,把branch想象成树枝,上面的每个commit都是一个cherry,cherry-pick就是摘取一个commit的意思。 ...
-
9
3 reasons I use the Git cherry-pick command Cherry-picking solves a lot of problems in Git repositories. Here are three ways...
-
6
Table of Contents Intro Without much ado, let's get right into it... So, the official git docs describe cherry-pick as the following:
-
6
-
10
Not FoundYou just hit a route that doesn't exist... the sadness.LoginRadius empowers businesses to deliver a delightful customer experience and win customer trust. Using the LoginRadius Identity...
-
8
Mastering Git Cherry-pick April 8, 2022 · 7 分钟 · TripleZ 本文希望教你如何成为一个 git cherry-pick 的 “master”!通过使用 git cherry-pick 来轻松地维护多...
-
6
Git Cherry Pick 的後遺症 2020-10-15 10:26 PM 9 10,...
-
5
How git cherry-pick and revert use 3-way merge • git • Hello! I was trying to explain to someone how
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK