From 3881b4031c2ec30bb7f47e210580d7580e26c452 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 4 Apr 2017 11:04:27 -0300 Subject: Adds git-disable-push --- git-disable-push | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 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 -- cgit v1.2.3