From: Silvio Rhatto Date: Tue, 4 Apr 2017 14:04:27 +0000 (-0300) Subject: Adds git-disable-push X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=3881b4031c2ec30bb7f47e210580d7580e26c452;p=utils-git.git Adds git-disable-push --- diff --git a/git-disable-push b/git-disable-push new file mode 100755 index 0000000..2f9e05c --- /dev/null +++ b/git-disable-push @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Disable push to a given remote +# See http://stackoverflow.com/questions/10260311/git-how-to-disable-push?answertab=active#tab-top + +# Parameters +BASENAME="`basename $0`" +REMOTE="$1" + +# Check +if [ -z "$REMOTE" ]; then + echo "usage: $BASENAME " + exit 1 +fi + +# Run +git remote set-url --push $REMOTE no_push