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)

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

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

相关推荐
暮云星影6 小时前
git版本发布
git·gitee·github·gitea
乌夷6 小时前
Git Flow 分支模型
git
独隅6 小时前
VS Code Git 工作树多分支并行开发实战评测
git
暮云星影11 小时前
git仓库分支管理
git·gitee·github·gitea
互联网中的一颗神经元1 天前
ZZ — Git 速查表
大数据·git·elasticsearch
早安试言1 天前
git使用
git
燐妤1 天前
梦绘片场 ProjectDream故事总纲场景剧本篇:从项目到成片的 AI 漫剧工作台
人工智能·git·ai·项目开发
JackieDYH2 天前
Git 与 GitHub 新电脑配置指南(从零开始)
git·github·工具·使用教程
Jeanyia2 天前
GitLab 配套 Git 常用命令
git·gitlab
10mAh2 天前
【Git】误删分支、reset --hard 后提交丢了怎么办?——reflog、fsck 与安全恢复实战
数据库·git·安全·回归