参考:https://blog.csdn.net/technofiend/article/details/51361393
http://www.jb51.net/article/110277.htm
https://blog.csdn.net/technofiend/article/details/70792815
http://blog.chinaunix.net/uid-29616823-id-4437149.html
1. 勾子
在 .git/hooks/ 目录下
新建一个名为 post-checkout 的文件
将下列内容保存
#!/bin/sh
pwd
echo "This is post-checkout hook"
chmod -R 755 ./* && chown -R www:www ./*
- 1
- 2
- 3
- 4
使post-checkout可以被调用
chmod +x post-checkout
2. 让git忽略检查文件权限的改动:
git config core.filemode false执行该命令后即可