X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=inline;f=copy-scripts%2Fcopy-scripts;fp=copy-scripts%2Fcopy-scripts;h=2201c0faf5602ed96efb978f62352fa3b95d4505;hb=5e1ae12d726ec5594426315bea7ee6a0b85b8bd1;hp=0000000000000000000000000000000000000000;hpb=037a42d9be1b5303ee8d0c447b9d8f68b332fc7e;p=git-scripts.git diff --git a/copy-scripts/copy-scripts b/copy-scripts/copy-scripts new file mode 100755 index 0000000..2201c0f --- /dev/null +++ b/copy-scripts/copy-scripts @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copy git-scripts to an ssh-accessible remote host; +# setup bare and non-bare repositories and the post-update hook. + +if [ $# -ne 3 ]; then + echo "Usage: $0 [user@]host directory remote_name" >&2 + exit 1 +fi + +remote_host="$1" +remote_dir="$2" +remote_name="$3" + +ssh "$remote_host" "cd $remote_dir && exec git init --bare git-scripts.git" && +git remote add "$remote_name" "$remote_host:$remote_dir/git-scripts.git" && +git push "$remote_name" master && +exec ssh "$remote_host" "cd $remote_dir && git clone git-scripts.git && + cd git-scripts.git/hooks && + exec ln -s ../../git-scripts/copy-scripts/post-update"