X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/af20ee2b76c9916ab5afaf59b0b2eb0ee7ac66df..5c2cd6e6c2ac4d02afc5589955d081981b3cf132:/ikiwiki-makerepo diff --git a/ikiwiki-makerepo b/ikiwiki-makerepo index a97c060c2..b733bd13a 100755 --- a/ikiwiki-makerepo +++ b/ikiwiki-makerepo @@ -4,7 +4,7 @@ set -e rcs="$1" srcdir="$2" repository="$3" - + usage () { echo "usage: ikiwiki-makerepo svn|git srcdir repository" >&2 echo " ikiwiki-makerepo bzr|mercurial srcdir" >&2 @@ -21,6 +21,10 @@ if [ ! -d "$srcdir" ]; then fi if [ "$rcs" != mercurial ] && [ "$rcs" != bzr ]; then + if [ -z "$repository" ]; then + echo "you need to specify both a srcdir and a repository for $rcs" >&2 + usage + fi if [ -e "$repository" ]; then echo "repository $repository already exists, aborting" >&2 exit 1 @@ -58,10 +62,12 @@ git) cd "$srcdir" git init echo /.ikiwiki > .gitignore + echo /recentchanges >> .gitignore git add . git commit -m "initial commit" git remote add origin "$repository" git config branch.master.merge refs/heads/master + git config branch.master.remote origin git push --all echo "Directory $srcdir is now a clone of $rcs repository $repository" ;;