tjun1
10/11/2017 - 9:36 AM

[pre-push] masterにpush禁止 #git

[pre-push] masterにpush禁止 #git

#!/usr/bin/env bash

# ネタ元 http://thinca.hatenablog.com/entry/20150306/1425639218
while read local_ref local_sha1 remote_ref remote_sha1
do
  if [[ "${remote_ref##refs/heads/}" = "master" ]]; then
    echo "Do not push to master branch!!!"
    exit 1
  fi
done