简体   繁体   English

推送后文件未更新

[英]Files not updated after push

Situation: 情况:

Making commit, open pull request, and the test failing, then I'm making amend (git commit --amend and git push --force) for fixing this test. 进行提交,打开请求请求和测试失败,然后我进行修改(git commit --amend和git push --force)以修复此测试。 Test is definitely fixed, but after force push the build on drone is failing again with the same error. 测试肯定是固定的,但是在强行推动后,无人机上的构建再次失败,并出现相同的错误。

New commits sometimes help, sometimes not. 新提交有时会有所帮助,有时却没有帮助。 In a case, when new commits doesn't help, I don't know how to fix a problem, it can take hours or days of experimenting (creating new commits, pushing to the same branch, but still the same error, which definitely doesn't exists in commit, which drone builds or at least shows it) until drone stops to build some very old state(first commit) of files. 在某种情况下,当新提交无济于事时,我不知道如何解决问题,这可能需要花费数小时或数天的时间进行试验(创建新的提交,推送到同一分支,但仍然是相同的错误,这肯定会在提交中不存在,提交会生成或至少显示出来),直到无人机停止构建某些非常老的状态(首次提交)为止。

Is there at least any workaround, what I can do manually to fix this problem? 至少有任何解决方法,我可以手动解决此问题?

Removing cache doesn't help. 删除缓存无济于事。 Drone restart doesn't help. 无人机重启无济于事。

Drone version: drone/drone:0.8.5 无人机版本:无人机/无人机:0.8.5

We use it with github, sometimes I think, it can be some problem of github cache, because the problem mostly disappears from them-self without any reasons. 我们将它与github一起使用,有时我认为这可能是github缓存的问题,因为该问题在没有任何原因的情况下从他们自己身上消失了。 Because it is a pull request and may be there is error between commit hash it gets from webhook and actual changes, it fetches from github. 因为这是一个请求请求,并且可能从Webhook获取的提交哈希与实际更改之间存在错误,所以它从github获取。

As Urban commented, it's really hard to get a clear idea of the present problem, but let's start by clarifying a point which seems to be central here : 正如Urban所评论的那样,要弄清当前问题确实很难,但让我们首先澄清一个似乎很重要的观点:

I'm making amend for fixing that test (sic) 我正在修正该测试(原文如此)

If by that you mean that you already committed your work but did a git commit --amend to add some changes into that commit, BUT you already pushed to the remote repo, then your mention about a force push might make sense. 如果那意味着您已经提交了您的工作,但是执行了git commit --amend来向git commit --amend中添加一些更改,但是您已经将其推送到远程仓库,那么提到强制推送可能就很有意义。

I'll just guess your remote refused your push because modifying a past commit in the tree is rewriting history and you can't do that by default, thus the needed subsequent git push -f . 我只是猜测您的遥控器拒绝了您的推送,因为修改树中的过去提交会重写历史记录,并且您默认情况下不能这样做,因此需要后续的git push -f

Short answer would be : don't amend already pushed commits. 简短的答案是: 不要修改已经推送的提交。 Add new commits on top instead. 而是在顶部添加新的提交。

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

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