Skip to content

Instantly share code, notes, and snippets.

@pclouds
Created March 16, 2010 14:15
Show Gist options
  • Save pclouds/334003 to your computer and use it in GitHub Desktop.
Save pclouds/334003 to your computer and use it in GitHub Desktop.
git-peer.sh
#!/bin/sh
. git-sh-setup
URL="$1"
host=${URL/:*/}
path=${URL/*:/}
ssh "$host" git ls-peer "$path" > $GIT_DIR/peer.tmp
eval `sed -n '1,/^$/p' $GIT_DIR/peer.tmp`
if [ -n "$name" -a -n "$url" ]; then
echo "Adding $name"
git remote add $name $url
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment