Add my script for opening GitUp
- ID
28fb060- date
2022-03-19 09:10:42+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
7730131- message
Add my script for opening GitUp- changed files
1 file, 17 additions
Changed files
gup (0) → gup (570)
diff --git a/gup b/gup
new file mode 100755
index 0000000..0309e0e
--- /dev/null
+++ b/gup
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# This opens my current working directory as a Git repository in GitUp,
+# my Git GUI of choice (https://gitup.co/).
+#
+# It finds the top level of the Git repository, then opens that, rather
+# than the current working directory -- if you run `open -a GitUp.app .`
+# in a subdirectory of a Git repository, you get an error:
+#
+# could not find repository from '/git/repository/subdirectory'
+#
+# This could be easily adapted to open a different Git GUI.
+
+set -o errexit
+set -o nounset
+
+ROOT=$(git rev-parse --show-toplevel)
+open -a GitUp.app "$ROOT"