从 gitlab 仓库中查询某个关键字
python GitPythonCheck.py [分支] [关键字] [项目列表]
python GitPythonCheck.py dev '\"tts' lesson,home,onboarding
find regex: tts from projects: ['lesson'] branch: dev
clone lesson dev...
work_path: ./gitPython/lesson
--- find from project lesson ---
TrailClassAuxServiceImpl.java
[186, 232, 233, 390, 465, 466]
LessonAuxServiceImpl.java
[772, 812]
UserUtils.java
[54, 80]
LotteryServiceImpl.java
[85, 86]
替换脚本中 https://gitlab.xxx.com/backend/
为自己的地址
git pre push hook, 阻止本地对特殊分支 git push -f 操作
根据需要修改保护分支:PROTECTED_BRANCHS=("master" "rc" "dev")
- mkdir $HOME/.githooks
- cd $HOME/.githooks
- vim pre-push
- git config --global core.hooksPath $HOME/.githooks
- chmod +x $HOME/.githooks/pre-push