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)

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

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

相关推荐
AOI小白新手上路41 分钟前
autodl无卡模式下载NTURain 训练集实录:基于 Git 部分克隆与稀疏检出的数据拉取
大数据·git·elasticsearch
天府云创1 小时前
Anthropic重做Git:Scion——Agent时代的版本管理系统
git·svn·版本控制·软件设计·迭代升级·scion
wflynn4 小时前
GitHub 今日推荐|open_scion:为AI代理设计的并发版本控制
git·开源·go·github·agent·coding-agents
初願致夕霞4 小时前
Git 指南
大数据·git·elasticsearch
爱喝热水的呀哈喽7 小时前
cxmt research
git
爱喝热水的呀哈喽7 小时前
概论research
git
鶴哥只手遮天20 小时前
Gitea源码深度剖析-第6章 Git 底层封装与仓库存储
git·开源
鶴哥只手遮天20 小时前
Gitea源码深度剖析-第2章 启动流程与配置体系
git·开源
鶴哥只手遮天20 小时前
Gitea源码深度剖析-第4章 数据库层与 ORM 体系(xorm)
git·开源
鶴哥只手遮天20 小时前
Gitea源码深度剖析-第5章 权限体系
git·开源