当前位置: 首页> 娱乐> 影视 > git命令之git cherry-pick

git命令之git cherry-pick

时间:2025/7/15 10:49:49来源:https://blog.csdn.net/weixin_45828554/article/details/140905573 浏览次数:0次

项目场景:

使用git命令,合并代码时

问题描述

使用git命令,合并代码时,提示不能合并:

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. 修改的文件有代码冲突

解决方案:

就用提示的命令,先取消合并

(use "git cherry-pick --skip" to skip this patch)(use "git cherry-pick --abort" to cancel the cherry-pick operation)

(有一种老牌方法,就是把 文件进行覆盖,这样可以保证 分支的代码都是一样的;
思考:什么场景用这种情况?)

关键字:git命令之git cherry-pick

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: