Created
June 19, 2026 14:53
-
-
Save EscApp2/ec6337e53c19b62487c26d474a4d515c to your computer and use it in GitHub Desktop.
change rights after git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .git/hooks/post-merge | |
| #!/bin/bash | |
| TARGET_DIR="XXXXXXXXXXXXXX" | |
| echo "[post-merge] Updating permissions and ownership in $TARGET_DIR" | |
| echo "[post-merge] Excluding some directories" | |
| find "$TARGET_DIR" \ | |
| \( -path "$TARGET_DIR/.git" \ | |
| -o -path "$TARGET_DIR/.well-known" \ | |
| -o -path "$TARGET_DIR/bitrix" \ | |
| -o -path "$TARGET_DIR/upload" \ | |
| -prune -o -type f -exec chmod 644 -- {} + -exec chown bitrix:bitrix -- {} + | |
| find "$TARGET_DIR" \ | |
| \( -path "$TARGET_DIR/.git" \ | |
| -o -path "$TARGET_DIR/.well-known" \ | |
| -o -path "$TARGET_DIR/bitrix" \ | |
| -o -path "$TARGET_DIR/upload" \ | |
| -prune -o -type d -exec chmod 755 -- {} + -exec chown bitrix:bitrix -- {} + | |
| echo "[post-merge] Permissions and ownership updated" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1)Ошибка: | |
| fatal: cannot exec '.git/hooks/post-merge': No such file or directory | |
| Команда | |
| file .git/hooks/post-merge | |
| Если ответ содержит " with CRLF line terminators" | |
| исполнить sed -i 's/\r$//' .git/hooks/post-merge | |
| 2)Ошибка | |
| The '.git/hooks/post-merge' hook was ignored because it's not set as executable. | |
| Исполнить | |
| chmod +x .git/hooks/post-merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment