git pull checkout后文件权限变动

参考:https://blog.csdn.net/technofiend/article/details/51361393html

          http://www.jb51.net/article/110277.htmgit

         https://blog.csdn.net/technofiend/article/details/70792815bash

         http://blog.chinaunix.net/uid-29616823-id-4437149.htmlapp


1. 勾子post

在 .git/hooks/ 目录下 
新建一个名为 post-checkout 的文件ui

将下列内容保存spa

#!/bin/sh
pwd
echo "This is post-checkout hook"
chmod -R 755 ./* && chown -R www:www ./*
  • 1
  • 2
  • 3
  • 4

使post-checkout能够被调用 
.net

chmod +x post-checkoutunix

2. 让git忽略检查文件权限的改动:
git config core.filemode false执行该命令后便可
code