summaryrefslogtreecommitdiff
path: root/bin/git-unbare
diff options
context:
space:
mode:
Diffstat (limited to 'bin/git-unbare')
-rwxr-xr-xbin/git-unbare11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/git-unbare b/bin/git-unbare
new file mode 100755
index 00000000..1a10b4ad
--- /dev/null
+++ b/bin/git-unbare
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$(git config --local --bool core.bare)" = "true" ]; then
+ mkdir .git
+ mv * .git
+ git config --local --bool core.bare false
+ git reset --hard
+else
+ echo >&2 "fatal: repository is not bare"
+ exit 1
+fi