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)

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

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

相关推荐
shark4 小时前
无需放弃变更、关闭占用程序!用暂存区和 git底层命令实现 Git 变更备份
git·shell·自动化运维
_poplar_5 小时前
15 【C++11 新特性】统一的列表初始化和变量类型推导
开发语言·数据结构·c++·git·算法
北城笑笑5 小时前
Git 10 ,使用 SSH 提升 Git 操作速度实践指南( Git 拉取推送响应慢 )
前端·git·ssh
蓁蓁啊11 小时前
GIT使用SSH 多账户配置
运维·git·ssh
相与还16 小时前
IDEA和GIT实现cherry pick拣选部分变更到新分支
git·elasticsearch·intellij-idea
刘志辉1 天前
git指令
git
2501_916766541 天前
【Git学习】初识git:简单介绍及安装流程
git·学习
孤独的追光者1 天前
Git 完整流程:从暂存到推送
git
平平无奇。。。1 天前
版本控制器之Git理论与实战
linux·git·gitee·github
这周也會开心2 天前
Git介绍和使用
git