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)

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

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

相关推荐
程序员果子39 分钟前
CrewAI :当 Agent 学会团队协作
人工智能·git·python·多智能体·agent框架
‎ദ്ദിᵔ.˛.ᵔ₎1 小时前
Git GDB/CGDB调试器
git·gdb
他们都叫我GPT侠3 小时前
【无标题】
git·github
果汁华3 小时前
CLI 命令行与 Python 框架实战
git·python·github
zzzzzz3104 小时前
我用 AI Agent 重构了日常开发工作流,效果出乎意料
人工智能·git·github
我叫黑大帅18 小时前
git 的 NFD 与 NFC 有什么区别?为什么我有个文件在 NFC 中间不会被当成改动,在 NFD 中就会当成改动
git·面试·github
呆萌很21 小时前
Git push 408 超时、远程断开解决办法
git
Lesile21 小时前
Hands-on Git experience
git
Co_Hui1 天前
Git 基本使用
git
cooldream20091 天前
AI 时代,Git 应该怎么学
人工智能·git