git push 错误地声称“一切都是最新的”

发布于 2024-12-28 02:21:57 字数 271 浏览 0 评论 0原文

我已经配置了 git,以便我可以使用公钥通过 SSH 将本地开发存储库推送到我的 Web 服务器。服务器上的裸存储库设置有一个接收后挂钩,该挂钩将所有文件检出到正确的位置。

一切都很顺利,直到今天我手动更改了服务器上某些文件的权限。 再次尝试命令

git push web

后,它给了我很多权限错误,因为它无法访问远程存储库文件。所以我将权限改回之前的权限并再次尝试。然而,现在它说“一切都是最新的”,但较新的版本尚未在我的服务器上。

我可以做什么来解决这个问题?

I have configured git so that I can push my local dev-repository to my web server via SSH using public keys. The bare repository on the server is set up with a post-receive hook that checks out all the files into the right location.

It all worked nicely until today I manually changed the permissions of some files on the server. After trying the command

git push web

again, it gave me a lot of permission errors because it couldn't access the remote repository files. So I changed the permissions back to what they were before and tried again. However, now it says 'Everything up-to-date' but the newer version is not on my server yet.

What can I do to resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守望孤独 2025-01-04 02:21:57

可能是存储库已更新,并且由于您提到的权限问题,后接收失败。最简单的修复方法是再进行一次提交和推送。或者进入服务器并自己运行 post-receive 。

请注意,后接收不会影响推送的结果,因此即使失败,推送仍然会完成。这就是你观察这一点的原因。

It could be that the repo is updated and the post-receive failed due to permission issue like you mentioned. Easiest way to fix would be to make one more commit and push. Or go on server and just run the post-receive yourself.

Note that the post-receive does not affect the outcome of the push and hence even if it fails the push is still done. That is why you are observing this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文