+### xxx ideally we should not need to git checkout anything
+# which would in addition remove the need for a non-bare repo
+# this would take a bit more time though
+
+# make sure we keep track of the current branch upon exit
+function current_branch () {
+ git branch | grep '^\*' | cut -d' ' -f2
+}
+