Summary Files Commits Branches @commit @diff @stats
path: root / scripts / checkout
diff options
context:
space:
mode:
1 files changed, 18 insertions, 0 deletions
-rwxr-xr-xscripts/checkout18
diff --git a/scripts/checkout b/scripts/checkout
new file mode 100755
index 0000000..26a36b0
--- /dev/null
+++ b/scripts/checkout
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ -z "$1" ]
+then
+ printf 'Repository: '
+ read
+ set "$REPLY"
+fi
+
+if [ -z "$2" ]
+then
+ printf 'Branch : '
+ read
+ set "$1" "$REPLY"
+fi
+
+cd "$1" && \
+git symbolic-ref HEAD refs/heads/"$2"