gpt4 book ai didi

git - 如何解决 "delete/modify"引起的 "git stash apply"冲突

转载 作者:IT王子 更新时间:2023-10-29 01:27:54 25 4
gpt4 key购买 nike

我最近做了一个 git stash,然后在分支上做了一些工作并提交了它,在尝试做一个 git stash apply 时遇到了这些错误:

CONFLICT (delete/modify): app/controllers/orders_controller.rb deleted in Updated upstream and modified in Stashed changes. Version Stashed changes of app/controllers/orders_controller.rb left in tree.
CONFLICT (content): Merge conflict in app/models/product.rb

git status 显示如下:

 $ git status
# On branch develop
# Your branch is ahead of 'origin/develop' by 16 commits.
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# deleted by us: app/controllers/orders_controller.rb
# both modified: app/models/product.rb

标记为“delete/modify”的文件是我在stash之前添加但尚未提交的新文件。
我想回到 git stash 之前的状态——有未提交的本地更改。您能建议如何做到这一点吗?

谢谢。

最佳答案

这对我有用。

做一个-

git mergetool

然后你会被要求选择修改或删除的文件或中止,然后再做一次-

git mergetool

这将解决 merge 冲突,您可以 stash pop 式更改。

关于git - 如何解决 "delete/modify"引起的 "git stash apply"冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10056165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com