網站首頁 編程語言 正文
1、進入項目根目錄 .git 目錄
cd .git/hooks/
2、新建 post-merge 文件
vim post-merge
3、寫入鉤子內容
#!/bin/sh
pwd
echo "This is post-merge hook"
chmod -R 755 ./* && chown -R www:www ./*
4、給予運行權限
chmod +x post-merge
git checkout 操作
1、進入 .git 目錄
cd .git/hooks/
2、新建 post-checkout 文件
vim post-checkout
3、寫入鉤子內容
#!/bin/sh
pwd
echo "This is post-checkout hook"
chmod -R 755 ./* && chown -R www:www ./*
4、給予運行權限
chmod +x post-checkout
看了鉤子內容應該大家都明白了,其實就是把手動運行的內容放入了鉤子函數。在執行git pull
命令時,會自動調用post-merge
。在執行git checkout
時,會自動調用post-checkout
.
這樣我們以后就不用再操心,怕遺忘權限有沒有修改的問題了.?
原文鏈接:https://itdream.blog.csdn.net/article/details/130973505
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-09-22 Redis配置文件redis.conf詳解
- 2022-03-27 C++浮點數在內存中的存儲詳解_C 語言
- 2022-07-29 Python控制線程和函數超時處理_python
- 2023-01-28 Python多線程與同步機制淺析_python
- 2022-04-01 k8s報錯error: You must be logged in to the server (U
- 2023-01-31 GraphQL在Django中的使用教程_python
- 2023-03-22 swift依賴注入和依賴注入容器詳解_Swift
- 2022-10-26 Go?語言數據結構之雙鏈表學習教程_Golang
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支