我们如何实现服务器端挂钩或任何类似的解决方案,以将git push限制到git server中?
例如,我们要禁用推送包含* .class文件的提交。
答案 0 :(得分:1)
我不认为Azure DevOps使用钩子。
您可以使用Branch Policies来使用外部验证服务(据我所知,它使用Web挂钩)。
其他:this User Voice请求的状态指示以上为正式答案。
但是也许简单的情况是.gitignore
和代码审查?
答案 1 :(得分:1)
我要做的是将生成选项与Azure DevOps中的策略一起使用。这是我的azure-pipelines.yml
文件:
---
trigger:
branches:
exclude:
- '*'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sudo apt-get install python3-pip
displayName: 'Install Python PIP'
- script: sudo apt-get install python3-setuptools
condition: succeeded()
displayName: Install Python SetupTools
- script: sudo pip3 install -r requirements.txt
condition: succeeded()
displayName: Install Python PIP Packages
- task: PythonScript@0
inputs:
scriptSource: filePath
scriptPath: hooks/lint_checker.py
pythonInterpreter: python3
condition: succeeded()
displayName: Lint Checker
答案 2 :(得分:1)