git push, but suppresses GitHub branch protection for admins on pushed branches.
Put this file to any location in your
$PATH and make it executable.
git-push command. If protected branch is detected, it removes status check requirement for admins, pushes, and reverts requirements for admins. This allows you to bypass status checks, but does not allow force push. Non-admin users cannot use this utility.
$ git push Counting objects: 1, done. Writing objects: 100% (1/1), 184 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) remote: error: GH006: Protected branch update failed for refs/heads/somebranch. remote: error: 2 of 2 required status checks are pending To email@example.com:myorg/coolrepo.git ! [remote rejected] somebranch -> somebranch (protected branch hook declined) error: failed to push some refs to 'firstname.lastname@example.org:myorg/coolrepo.git' $ git nudge Pushing dry Requesting refs/heads/somebranch protection status Removing somebranch protection Counting objects: 1, done. Writing objects: 100% (1/1), 184 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To email@example.com:myorg/coolrepo.git 7928557..675e5ae somebranch -> somebranch Reverting somebranch protection