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

Version Path
neeto-commons-backend-1.0.109 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.108 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.107 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.106 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.105 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.104 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.103 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.102 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.101 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.100 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.99 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.98 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.97 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.96 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.95 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.94 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.93 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.92 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.91 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh
neeto-commons-backend-1.0.90 lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh