Dan*_*nds 6 git git-submodules
我一直在研究使用git部署站点的不同方法,并找到了以下教程:
http://42pixels.com/blog/quick-and-dirty-git-deployment
我喜欢本教程中提出的想法,并且热衷于将它用于我的网站,只是它似乎不支持子模块.
无论如何,这可以改变,以便子模块也被拉入并根据需要更新?
谢谢.
UPDATE
我在过去的几个小时里一直在研究这个问题,而且我似乎在取得进展,但我仍然无法让它发挥作用.
我已经切换到这个教程:http://toroid.org/ams/git-website-howto(大致相同,只是一些细微的变化),并在遵循一些建议后发现:https:// stackoverflow .com/a/6636509/1049688我最终得到了一个接收后的文件,如下所示:
#!/bin/sh
export GIT_WORK_TREE=/srv/www/limeblast.co.uk/htdocs_test
export GIT_DIR=/srv/www/limeblast.co.uk/.git
cd $GIT_WORK_TREE
git checkout -f master
git submodule init
git submodule update
Run Code Online (Sandbox Code Playgroud)
理论上这一切似乎都很好,并且看起来子模块命令正在运行,但我收到以下错误消息:
remote:子模块'wordpress'(git://github.com/WordPress/WordPress.git)注册路径'wordpress'remote :子模块'wp-content/themes/limeblastevolution/inc/cssCrush'(git:// github. com/peteboere/css-crush.git)注册路径'wp-content/themes/limeblastevolution/inc/cssCrush'remote :致命:工作树'/srv/www/limeblast.co.uk/htdocs_test'已经存在. remote:将'git://github.com/WordPress/WordPress.git'克隆到子模块路径'wordpress'失败
有任何想法吗?谢谢.
您可能在git-deploy上取得了成功.
但是,如果这太过于关注Rails,或者由于其他原因你不能或不会使用它,这里是如何在post-commit钩子中强制子模块更新:
git submodule init && git submodule sync && git submodule update
Run Code Online (Sandbox Code Playgroud)
您必须在服务器上运行它; 所以最好把它添加到你的hooks/post-receive脚本中.它是简单的BASH或SH,bytheway.
| 归档时间: |
|
| 查看次数: |
3221 次 |
| 最近记录: |