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