开发者

Web-based git: how to copy all files except some to webroot?

开发者 https://www.devze.com 2023-04-13 01:19 出处:网络
I have set up git on our webserver in a similar fashion as: http://toroid.org/ams/git-website-howto The following post-receive hook is set up:

I have set up git on our webserver in a similar fashion as: http://toroid.org/ams/git-website-howto

The following post-receive hook is set up:

#!/bin/sh
GIT_WORK_TREE=/var/www/ git checkout -f

This works fine. However, there are certain directories and f开发者_JS百科iles that I do not want to copy to the webroot, but I do want them in the repository (so .gitignore is not an option). What is a good way to ignore them when checking out? Or should I copy them and then promptly remove them?


There was already the same question on Stack Overflow, with a solution: Reuse GIT_WORK_TREE in post-receive hook to rm a few files

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号