git使用钩子文件出现错误
git的钩子文件出现错误
- 问题打印:
- 解决办法
- 1.删除本地钩子文件
- 2. 恢复commit-msg钩子
- 3.重新提交工程
问题打印:
无法commit 1 个文件: .git/hooks/commit-msg: 行 1: 未预期的符号 <' 附近有语法错误 .git/hooks/commit-msg: 行 1:
Your browse does not support frame! ’
.git/hooks/commit-msg: 行 1: ` Your browse does not support frame! ’
The command “/usr/bin/git” terminated with exit code 1.
解决办法
1.删除本地钩子文件
rm .git/hooks/commit-msg
可以提交到本地,但是不能生成change-Id,无法推送到远程
2. 恢复commit-msg钩子
curl -o .git/hooks/commit-msg http://****/tools/hooks/commit-msg
chmod +x .git/hooks/commit-msg
3.重新提交工程
git commit --amend --no-edit