#!/bin/sh GITREMOTE=git.acdw.net GITROOT=/git git ls-files > /dev/null || exit 1 # consider --git-dir as well .. however --git-dir would require more massaging # of the output. local="$(git rev-parse --show-toplevel)" name="${local##*/}" remote="$GITROOT/$name.git" ## Remote work # Initiate the repository echo "ssh \"$GITREMOTE\" git init --bare \"$remote\"" ssh "$GITREMOTE" git init --bare "$remote" # Add a description echo -n "Repo description: "; read echo "ssh \"$GITREMOTE\" sh -c \"echo '$REPLY' > '$remote/description'\"" ssh "$GITREMOTE" sh -c "echo '$REPLY' > '$remote/description'" # Add post-update-hook echo "scp post-update.hook \"$GITREMOTE:$remote/hooks/post-update\"" scp post-update.hook "$GITREMOTE:$remote/hooks/post-update" ## Local work echo "git remote add origin \"$GITREMOTE:$remote\"" git remote add origin "$GITREMOTE:$remote"