如何卸载预提交

How to uninstall pre-commit

按照预提交 website 的 "non administrative installation" 说明,我 运行 以下命令:

curl http://pre-commit.com/install-local.py | python

这些说明提供了以下说明:“(升级:运行 再次,卸载:将卸载传递给 python)。

现在,我想卸载预提交。我试图了解如何将卸载传递给 Python。我不确定传递 uninstall 意味着什么。

我试过:

curl http://pre-commit.com/install-local.py | python --uninstall
curl http://pre-commit.com/install-local.py | --uninstall python
curl http://pre-commit.com/install-local.py | uninstall | python

..和其他几个可能更无意义的变体。所有这些导致:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Unknown option: -n
usage: /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
100  2590  100  2590    0     0  14175      0 --:--:-- --:--:-- --:--:-- 14230
(23) Failed writing body

这个怎么样:

curl http://pre-commit.com/install-local.py | python - uninstall

有非常精细的选项 -> pre-commit uninstall -h

删除每个挂钩:
pre-commit uninstall -t pre-commit -t pre-merge-commit -t pre-push -t prepare-commit-msg -t commit-msg -t post-commit -t post-checkout -t post-merge -t post-rewrite

Idiot-proof卸载:

pip install pre-commit \
&& pre-commit uninstall -t pre-commit -t pre-merge-commit -t pre-push -t prepare-commit-msg -t commit-msg -t post-commit -t post-checkout -t post-merge -t post-rewrite \
&& pip uninstall pre-commit -y