git命令之git cherry-pick

项目场景:

使用git命令,合并代码时

问题描述

使用git命令,合并代码时,提示不能合并:

c 复制代码
PS D:\xxx\testDemo> git cherry-pick commint号
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:                                      
                                                                           
    git commit --allow-empty                                               

Otherwise, please use 'git cherry-pick --skip'
On branch master
Your branch is up to date with 'origin/master'.

You are currently cherry-picking commit commint号.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean
PS D:\xxx\testDemo> 

原因分析:

  1. 修改的文件有代码冲突

解决方案:

就用提示的命令,先取消合并

c 复制代码
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

(有一种老牌方法,就是把 文件进行覆盖,这样可以保证 分支的代码都是一样的;

思考:什么场景用这种情况?)

相关推荐
Aurora_eye1 小时前
Git 笔记
笔记·git
解道Jdon2 小时前
FigCraft把Figma用Rust从零重写了一遍
ide·windows·git·svn·eclipse·github·visual studio
橙橙笔记3 小时前
QT安卓软件的制作
android·git·qt·软件
我是人✓4 小时前
Git远程协作与标签管理全攻略
git
闰土_RUNTU4 小时前
Git实用手册(持续更新)
git
Shaoshing5 小时前
ggggggggit
git
Lucky GGBond5 小时前
解决 Git 推送报错:Could not resolve host 及 DNS 劫持排查指南
git
川石课堂软件测试5 小时前
自动化测试|持续集成Git使用详解
git·python·jmeter·mysql·ci/cd·容器·kubernetes
陈聪.6 小时前
CI/CD 与 Git 工具使用知识总结
git·ci/cd
Tairitsu_H8 小时前
[版本控制器Git] Git 版本控制 | 三区模型与版本回退 | 分支管理
git·版本·分支·版本控制器·三区