简体   繁体   English

git ftp push覆盖错误。 尝试藏匿,拉力,推力,没有运气

[英]git ftp push overwrite error. Tried stashing, force pulling, force pushing, no luck

I'm having a problem where git won't let me push, giving me the "error: Your local changes to the following files would be overwritten by merge". 我遇到了git不允许我推送的问题,出现了“错误:对以下文件的本地更改将被merge覆盖”。

When I do a git pull it says that everything is up to date. 当我执行git pull它说一切都是最新的。 When I run git status it says "nothing to commit, working tree clean." 当我运行git status它说“什么也没提交,工作正常”。 However, I have a file I've made changes in so when I try to push it, it gives me the error described above. 但是,我已经更改了一个文件,因此当我尝试推送它时,它给了我上面描述的错误。 The file that git references when it throws the error is not the file that I'm trying to push. git引发错误时引用的文件不是我要推送的文件。

Some details: 一些细节:

Our git is set up to push to our dev site. 我们的git被设置为推送到我们的开发站点。 So when we're working on a site, we are working on the master branch for the dev site. 因此,当我们在网站上工作时,我们正在开发网站的master分支上。 When a file is pushed, the git pushes the file to the site's server via FTP. 推送文件时,git会通过FTP将文件推送到站点的服务器。

I suspect that this problem originated when one of our interns uploaded a file to the server for our dev site via WinSCP, not pushing it to the git and therefore causing problems. 我怀疑这个问题是当我们的一名实习生通过WinSCP将文件上传到我们开发站点的服务器时产生的,而不是将其推送到git并因此导致了问题。 The file that they uploaded this way is the file git specifies when it throws the error. 他们以此方式上传的文件是git在引发错误时指定的文件。

I've tried solving this issue with stashing to no avail. 我试图解决这个问题,但没有成功。 The error says "Please, commit your changes or stash them before you can merge." 该错误显示为“请先合并您的更改或将其存储起来,然后再进行合并”。 git status brings up nothing that needs committing. git status不会产生任何需要提交的内容。 I've tried to force a push and a pull and still get the error when I try to push a change. 我尝试强制执行推拉操作,但在尝试进行更改时仍然出现错误。

Any input would be appreciated. 任何输入将不胜感激。

Thanks 谢谢

After an unreasonable amount of trial and error I was able to fix it by doing a hard reset back to a commit from a week ago. 经过无数次的反复试验后,我能够通过将硬复位重新设置为一周前的提交来解决此问题。 Then I did a forced push and the problem went away 然后我用力推动,问题消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM