aboutsummaryrefslogtreecommitdiff
path: root/git-disable-push
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-04-04 11:04:27 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-04-04 11:04:27 -0300
commit3881b4031c2ec30bb7f47e210580d7580e26c452 (patch)
tree264086f190a9192544cb6896997fd833f5c77bf8 /git-disable-push
parent58d7c44affff801a412a5b1ac5f3240fb59be68b (diff)
downloadutils-git-3881b4031c2ec30bb7f47e210580d7580e26c452.tar.gz
utils-git-3881b4031c2ec30bb7f47e210580d7580e26c452.tar.bz2
Adds git-disable-push
Diffstat (limited to 'git-disable-push')
-rwxr-xr-xgit-disable-push17
1 files changed, 17 insertions, 0 deletions
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 <remote>"
+ exit 1
+fi
+
+# Run
+git remote set-url --push $REMOTE no_push