]> git.phdru.name Git - cookiecutter.git/commitdiff
Add script `add-remote` master
authorOleg Broytman <phd@phdru.name>
Tue, 28 Jan 2025 11:32:46 +0000 (14:32 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 28 Jan 2025 11:32:46 +0000 (14:32 +0300)
add-remote [new file with mode: 0755]

diff --git a/add-remote b/add-remote
new file mode 100755 (executable)
index 0000000..c6f96e2
--- /dev/null
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+if [ -z "$1" -o -z "$2" ]; then
+    echo "Usage: $0 remote_name URL " >&2
+    echo "Example: $0 gh https://github.com/phdru/cookiecutter.git"
+    exit 1
+fi
+
+git remote add "$1" "$2" &&
+exec git config --add update-remotes.remotes "$1"