git - 当文件可用时,预推无此类文件
问题描述
致命:无法运行 .git/hooks/pre-push:没有这样的文件或目录
.git/hooks/pre-push 中的预推送文件
#!/bin/env bash
echo "Running RSpec"
bundle exec rspec spec
spec=$?
if [ $spec -eq 0 ]; then
echo -en "\\033[32mTests are green, pushing...\\033[0;39m\n"
exit 0
else
echo -en "\\033[1;31mCannot push, tests are failing. Use --no-verify to force push.\\033[0;39m\n"
exit 1
fi
我跑了。。
chmod u+x .git/hooks/pre-push
并从这里获取代码:
解决方案
推荐阅读
- git - 由于冲突,带有 --preserve-merges 的 Git rebase 无法重新应用合并提交
- docker - 如何使用 docker-compose 发布端口(桥接默认网络)
- ruby-on-rails - 在多个方法中添加相同的代码
- python - 更改 numpy 数组的形状和 dtype
- reactjs - material-ui 选择框不显示选择
- javascript - 如何为每个 http 请求添加授权标头?
- scala - Spark - 如果主键匹配,则更新目标数据?
- java - 如何限制特定方法只执行一次,当使用工厂和数据提供者注释方法时?
- c++ - 我可以加载一个与库静态链接的dll吗
- css - 基于元素的存在向scss中的元素添加颜色类