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)

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

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

相关推荐
2401_8260976218 小时前
同步&异步日志系统-日志落地模块的实现
c++·git·vim
半旧夜夏19 小时前
阿里云IOT消息处理
java·ide·git·物联网·spring·阿里云
我们的五年20 小时前
【Git版本控制器】第三弹——版本回退,撤销修改,删除文件
大数据·linux·git
一名嵌入式糕手21 小时前
Git从基础到进阶
git
不cong明的亚子21 小时前
github用户名密码登陆失效了
git·github
QC七哥1 天前
git开发流程以及github社区企业版
git·github
邂逅you1 天前
GitHub基本操作及Git简单命令
git·github
EngZegNgi1 天前
git 提示 fatal: The remote end hung up unexpectedly
git
ricky_fan1 天前
本地部署MindSearch(开源 AI 搜索引擎框架),然后上传到 hugging face的Spaces——L2G6
人工智能·git·python
misty youth2 天前
github与git bash绑定问题
git·github·bash