1
提交代码时候的钩子
admin edited this page 2025-12-23 21:56:27 +08:00

1. 确保在正确的分支

git branch

2. 安装钩子

curl -o .git/hooks/commit-msg http://101.43.95.130:8082/tools/hooks/commit-msg chmod +x .git/hooks/commit-msg

3. 重置到提交前状态(如果需要)

git reset HEAD~1 --soft git commit -m "你的提交信息"

4. 或者修改现有的提交

git commit --amend --no-edit

5. 查看提交信息确认

git log -1

6. 推送

git push origin HEAD:refs/for/master