我正在尝试推送新的更改,但我有一个冲突的文件。尝试推送后,出现以下错误:
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
好的,所以我们需要使用 git pull。
我尝试使用git pull
然后我得到这个错误:
error: Your local changes to the following files would be overwritten by merge:
db/profile_edit.php
Please, commit your changes or stash them before you can merge.
但是,当我尝试提交时,我又回到了第一个错误。我应该怎么办?远程存储库上的更改比本地计算机上的更改新。那么,我如何使用 diff 工具打开它并进行更改,然后告诉 git 我已经进行了更改,以便它让我推送更改?
试着做
$ git pull --rebase
在您之前拉取远程更改,然后提交。看看它是否有效。
如果这不起作用,请尝试以下操作:
$ git stash
$ git pull --rebase
$ git stash pop
保存您的更改stash
,在您的工作存储库中应用远程提交,然后应用您的更改(保存到stash
)再次进入您的工作存储库。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)