Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W
wiki-php
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • 互联网应用开发
  • wiki-php
  • Wiki
  • envrioment

envrioment · Changes

Page history
Update envrioment authored Jun 22, 2021 by 互联网应用开发's avatar 互联网应用开发
Hide whitespace changes
Inline Side-by-side
Showing with 0 additions and 46 deletions
+0 -46
  • envrioment.md envrioment.md +0 -46
  • No files found.
envrioment.md
View page @ 0e2db55a
......@@ -113,52 +113,6 @@ file->settins->搜索 git
试试能不能用git了吧~~
### 设置git 的 pre-commit
```
cd 项目目录/web-php/.git/hooks
cp pre-commit.sample pre-commit
注意:先要确定pre-commit是可执行文件,如果不是可执行文件运行:chmod 755 pre-commit
vim pre-commit
将所有内容删除,替换为如下内容:
#!/bin/bash
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments.
# The hook should exit with non-zero status after issuing an appropriate message if it wants to stop the commit.
# To enable this hook, rename this file to "pre-commit".
# If you really not sure how to do that, you can use '--no-verify' to skip this check
# Like this:git commit -m 'update' --no-verify
#define file or dir
SENSITIVE=(system app-job/run.php app-job/class/bin/Abstract.php app-core/CacheDao.php)
#SENSITIVE=(server)
STAGE_FILES=$(git diff --cached --name-only)
if test ${#STAGE_FILES} -gt 0
then
echo 'Start checking files...'
echo $STAGE_FILES
for FILE in $STAGE_FILES;do
for NOTICE in ${SENSITIVE[@]};do
if [[ "$FILE" =~ "$NOTICE" ]];then
echo 'The commit failed because you modified the file:'$FILE
exit 1
fi
done
done
fi
exit 0
```
......
Clone repository
  • 360safeguardnativeapi
  • all new classmate
  • bind phone
  • code standard
  • deploy_sys
  • edit common
  • edit master
  • envrioment
  • find psw
  • front new classmate
  • front statck
  • git
  • Home
  • idcard md5
  • ide
View All Pages