项目场景:
使用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>
原因分析:
- 修改的文件有代码冲突
解决方案:
就用提示的命令,先取消合并
c
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
(有一种老牌方法,就是把 文件进行覆盖,这样可以保证 分支的代码都是一样的;
思考:什么场景用这种情况?)