cherry-pic

1、git checkout feature_target; 首先切换到要合并的分支;

git checkout remotes/origin/修改的分支

出现变化,Your local changes to the following files would be overwritten by checkout:

则 git Please commit your changes or stash them before you switch branches.

git stash

2、 git pull origin feature_target;

拉取对应分支上最新的变更;

git pull remotes/origin/修改的分支

3、git log;拿到要合并的commit节点;

git log -i --grep="北交所定向" # 忽略大小写搜索提交信息中的 "北交所定向"

此看不到cherry-pick的内容,

git log --cherry-pick -i --grep="北交所定向"

xx@BJ-840J0D3-7080 MINGW64 /d/xx/hqapp/xx/xxx/hqapp ((bcc1338...))

$ git log --cherry-pick -i --grep="北交所定向"

commit aaabbbcccddd

Author: xxx <xxx.Huang@xx.com.cn>

Date: Fri May 13 11:18:52 2022 +0000

北交所定向xx

4、 git checkout feature_me;

再回切到自己的分支;

branch/mineBranch

git checkout feature_me

git stash pop

5、 git cherry-pick aaabbbcccddd

6、git push origin feature_me;

***这里假定都是正常情况,没有出现冲突,直接将合并完成的结果推送远端,结束。

相关推荐
ezreal_pan8 个月前
误在非开发分支上开发解决方案
git·cherry-pick
gqkmiss9 个月前
Git Cherry-pick:核心命令、实践详解
前端·git·前端框架·commit·cherry-pick
安冬的码畜日常1 年前
【工欲善其事】利用 DeepSeek 实现复杂 Git 操作:从原项目剥离出子版本树并同步到新的代码库中
git·ai·powershell·cherry-pick·deepseek·deepseek r1·deepseek v3
命运之手1 年前
【Git】将其它分支的单个改动复制到当前分支
git·cherry-pick
rs勿忘初心1 年前
用了6年git,不知道cherry-pick是啥意思
git stash·cherry-pick·cherry-pick用法·git stash pop·cherry-pick使用示例
aimmon2 年前
Superset 二次开发之Git篇 git cherry-pick
git·bi·superset·cherry-pick