【发布时间】:2018-12-28 06:00:44
【问题描述】:
我一直在尝试设置 Git 来管理我的网站,正如 this tutorial 和 this one 和 this one 和 this one 和 this gist 所解释的那样。
总结一下我所做的:(深入的解释可以在教程中找到)
- 在
/home/usr/mysite.git/的 Web 服务器上设置一个裸 git 存储库 - 在裸仓库中,创建一个可执行的 post-receive 挂钩,并将
GIT_WORK_TREE设置为我的 Web 文档根目录/home/www/mysite.com/ -
在我的本地 git 存储库中,添加远程存储库。这是来自我的
.git/config:[remote "live"] url = ssh://user@ssh.myserver.com/home/usr/mysite.git fetch = +refs/heads/*:refs/remotes/live/* - 推送:
git push live +master:refs/heads/master
这是我得到的输出:
Everything up-to-date
太棒了!
除非它不是:我的远程 Web 文档根 /home/www/mysite.com/ 仍然为空。
我已尽我所能,但无法将文件推送到我的远程文件夹中。
你知道我做错了什么,或者我可以做些什么来调试它?
【问题讨论】:
-
在推送之前您是否在 Git 中提交了更改?
-
我有!感谢您确定:)
标签: git githooks git-remote git-bare