home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c32d9ee
)
Add script to push/pull .git/description
author
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 15 Dec 2019 13:47:06 +0000
(08:47 -0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Sun, 15 Dec 2019 13:47:06 +0000
(08:47 -0500)
home/bin/git-description
[new file with mode: 0755]
patch
|
blob
diff --git a/home/bin/git-description
b/home/bin/git-description
new file mode 100755
(executable)
index 0000000..
710336b
--- /dev/null
+++ b/
home/bin/git-description
@@ -0,0
+1,31
@@
+#! /bin/sh
+
+set -e
+
+exe="$0"
+cmd="$1"
+remote="$2"
+
+usage() {
+ printf "Usage: %s [push|pull] REMOTE\n" "$exe"
+ exit 1
+}
+
+case "$cmd" in
+ push | pull) ;;
+ *) usage ;;
+esac
+
+case "$remote" in
+ '') usage ;;
+ *) ;;
+esac
+
+remote_url=$(git remote get-url "$remote")
+remote_file="${remote_url}/description"
+local_file='.git/description'
+
+case "$cmd" in
+ push) scp "$local_file" "$remote_file";;
+ pull) scp "$remote_file" "$local_file";;
+esac
This page took
0.024072 seconds
and
4
git commands to generate.