因此,我有很多更改和一些未跟踪的文件。我需要进行一些调整,因此我使用git stash -u
了一些东西,进行了一些修改,进行了更改,然后进行了推送,然后尝试进行更改git stash pop
。
因为我修改了一些已藏匿的文件,所以收到以下消息:
error: Your local changes to the following files would be overwritten by merge:
file_1.py
file_2.py
Please, commit your changes or stash them before you can merge.
Aborting
这似乎很奇怪,我已经提交了所有新更改,运行命令时结帐是干净的。
看来该git stash pop
操作没有掩盖我所做的更改和未跟踪的文件的一半,但是如果我git stash pop
再次尝试,则会得到如下输出:
some_file.html already exists, no checkout
some_other_file.html already exists, no checkout
yet_another_file.html already exists, no checkout
Could not restore untracked files from stash
git stash show
仍然显示我已隐藏的更改的列表,但是我对现在的操作感到茫然。
我如何才能摆脱困境?
我解决了这个问题,我认为这肯定是某种错误,因为我的工作目录是最新的。
我跑了git checkout .
,然后git stash apply
一切正常,我什么都没回来。我很想找出实际上导致它失败的原因。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句