Sha256: 7ca03ee374b0739da955f68b06b4c358eb2fdd8fc0f73ca4d5c0fe7ba7f29253
Contents?: true
Size: 813 Bytes
Versions: 21
Compression:
Stored size: 813 Bytes
Contents
#!/bin/sh prevent_pushing_to_main() { current_branch=`git symbolic-ref HEAD` current_origin=`git remote` if [ current_origin = "origin" -o "$current_branch" = "refs/heads/master" -o "$current_branch" = "refs/heads/main" ] then cat <<EOT -------------------------------------------------------------------------------------- You are not authorized to push/commit directly to master/main branch in origin remote. Push from a new branch and make the PR. Or if you are 100% sure you want to push/commit to master/main branch, then pass in the optional --no-verify option with the git command. Example: # Warning: pushing to main is not recommended git push origin main --no-verify -------------------------------------------------------------------------------------- EOT echo ""; exit 1; fi }
Version data entries
21 entries across 21 versions & 1 rubygems