我最近做了一个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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
标记为"删除/修改"的文件是我添加的新文件,之前尚未提交stash
.
我想回到我之前所处的状态git stash
- 有未提交的本地更改.你能建议如何实现这一目标吗?
谢谢.
raj*_*240 11
这对我有用。
做一个-
git mergetool
Run Code Online (Sandbox Code Playgroud)
然后你会被要求选择修改或删除的文件或中止,然后再做一次 -
git mergetool
Run Code Online (Sandbox Code Playgroud)
这将解决合并冲突,您可以隐藏您的更改。
你正在把藏匿处带到另一个州; 有一个额外提交的州.更糟糕的是,正如您所知,提交引入了合并冲突.
您有两种选择:
听起来像#2就是你想要做的.使用:
git stash branch new_branch [<stash>] # <stash> will be the last one if not provided.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
15125 次 |
最近记录: |