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)

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

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

相关推荐
摇滚侠1 小时前
VsCode 自带的 Git 使用教程
ide·git·vscode
H***99761 小时前
Git物联网案例
git·物联网
g***B7382 小时前
Git版本控制工具对比
git
weixin_456904273 小时前
Git大文件管理与版本回退
大数据·git·elasticsearch
J***Q2926 小时前
Git虚拟现实开发
git·vr
油丶酸萝卜别吃7 小时前
GitHub 上查找中国乡镇经纬度范围数据的开源项目
git·github
9***P33418 小时前
Git测试框架使用指南
git
X***489620 小时前
Git数据分析应用
git
6***379420 小时前
Git安全
git·安全
z***I39421 小时前
Git机器学习
人工智能·git·机器学习