首页 > 解决方案 > 当文件可用时,预推无此类文件

问题描述

致命:无法运行 .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

并从这里获取代码:

https://gist.github.com/johnhamelink/577b8613ae82d2b3037b

标签: gitrspecgithooks

解决方案


推荐阅读