无法理解如何最好地在服务器上使用 CMS 设置裸存储库
我有一个运行我们的 CMS 的 DEV 服务器,我想从 CMS 安装中的存储库中提取数据并推送到该存储库 - 但我收到错误,因为我正在尝试推送到非裸存储库(我已经克隆了此远程存储库)本地)。
但据我了解,裸存储库实际上并不包含文件,这显然会成为查看 CMS 的问题 - 不确定这是否正确?
抱歉,如果这很简单,我在这里阅读了很多答案,但仍然无法理解当远程需要其中的文件时如何设置本地和远程存储库。
另外,我正在使用 Tower,因为我不太喜欢在命令行中使用 git。
任何帮助或建议将不胜感激。
干杯
本
I have a DEV server running our CMS and I would like to pull from and push to a repository in the CMS install - but I get errors because I'm trying to push to a non-bare repository (I've cloned this remote repository locally).
But from what I understand, a bare repository doesn't actually contain files which is obviously going to be a problem for viewing the CMS - not sure if this is correct?
Sorry if this is easy, I've been reading a lot of answers here but am still having trouble understanding how to set up my local and remote repositories when the remote needs files in it.
Also, I'm using Tower as I'm not too hot with git in the command line.
Any help or suggestions would be much appreciated.
Cheers
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Git 管理网站 详细介绍了如何完成此操作。
这个想法是推送到一个裸存储库(没有工作目录的存储库),并在将更新推送到裸存储库,这将更新您的 Web 根目录。
post-receive
挂钩中签出到您的 Web 文件夹。完成后,您可以使用简单的 git push通过该设置,您将拥有:
这会将 git 内容保留在您的 Web 根目录之外,以便它仅包含您的 CMS 文件。让事情变得更干净。
Using Git to manage a web site has a good run-down on how this is done.
The idea is to push to a bare repo (one that does not have a working directory), and checkout to your web folder in a
post-receive
hook. Once you have that, you can push your updates to the bare repo with a simplegit push <remote_name>
, and that will update your web root.With that setup you have:
That keeps the git stuff out of your web root, so that it contains only your CMS files. Makes things cleaner.
你好,我同意你的观点,让你了解 git 是一个陡峭的学习曲线。在最近的记忆中经历过它。我们有一个叫 Jerremy Skinner 的人,他知道他的东西 - 他的 git 入门视频指南在这里 http:// /www.ava.co.uk/git - 第一个大约 5 分钟。
Hi I agree with you that getting you head around git is a steep learning curve. Having been through it in recent memory. We had a guy called Jerremy skinner who knows his stuff - his video guide to getting going with git is here http://www.ava.co.uk/git - the first one is about 5 mins.