I needed this quite a bit in the last few days, basic script but
serves my need. I think it would be useful for other beginners if in
$git/contrib/ source dir.

Just a start to a basic script. Needs more tests etc, but it's enough
to get newbies (like me) off to a reasonable start. Handles multiple
input dirs.

PLEASE CC me, as I am not subscribed.

(some SMTP server rejected attachment, so pasting below instead)



# Change one or more normal repos into bare repos:
# See also 

for i in "$@"; do
   echo; echo "----------------------"
   echo Processing $i

   repo="`basename $i`"

   # Insert here: may be exit if any spaces in repo fqn
   # Insert here: check for non-existent repo/.git dir
   # Insert here: check that we are not inside the repo
   # Insert here: add exit/do-nothing if fail to mv dirs etc

   mv $repo/.git $tmp_repo
   git --git-dir=$tmp_repo config core.bare true
   mv $repo ${repo}.bak
   mv $tmp_repo $repo
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to