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;
***这里假定都是正常情况,没有出现冲突,直接将合并完成的结果推送远端,结束。