【发布时间】:2019-12-26 17:53:07
【问题描述】:
我正在尝试添加一个pre-commit 脚本。
脚本有效,但 Git 忽略了对文件的更改。似乎 Git 忽略了我在 .git 中所做的任何更改,但在 .gitignore 中没有指定。
例如:
# Add a hook that runs Hello, World!
echo "#\!/bin/sh \n echo 'Hello, World!'" > .git/hooks/pre-commit
# Make the hook runnable
chmod +x .git/hooks/pre-commit
# Check changes
git status
# > Your branch is up to date with 'origin/master'.
# > nothing to commit, working tree clean
因此,如何将我的钩子提交到存储库?
【问题讨论】:
标签: git