#!/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 "ssh \"$GITREMOTE\" ed \"$remote/description\"" ssh "$GITREMOTE" ed "$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"