我执行了一个 git stash pop
命令,结果出现了合并冲突。我从文件系统中删除了这些文件,并像下面这样执行了一个 git checkout
命令,但是 Git 认为这些文件仍然没有合并。接着我尝试替换这些文件并再次执行 git checkout
命令,但结果相同。我甚至使用了 -f
标志来强制执行。如果有任何帮助,将不胜感激!
chirag-patels-macbook-pro:haloror patelc75$ git status
app/views/layouts/_choose_patient.html.erb: needs merge
app/views/layouts/_links.html.erb: needs merge
# On branch prod-temp
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: db/schema.rb
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# unmerged: app/views/layouts/_choose_patient.html.erb
# unmerged: app/views/layouts/_links.html.erb
chirag-patels-macbook-pro:haloror patelc75$ git checkout app/views/layouts/_choose_patient.html.erb
error: path 'app/views/layouts/_choose_patient.html.erb' is unmerged
chirag-patels-macbook-pro:haloror patelc75$ git checkout -f app/views/layouts/_choose_patient.html.erb
warning: path 'app/views/layouts/_choose_patient.html.erb' is unmerged
git stash apply/pop
前的状态应该更容易了,因为现在工作树需要保持干净:请参见我的下面的回答。 - VonC