Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created July 19, 2013 12:07
Show Gist options
  • Save mmalecki/6038681 to your computer and use it in GitHub Desktop.
Save mmalecki/6038681 to your computer and use it in GitHub Desktop.
Easily fetch from your network on GitHub
#!/bin/sh
username=$1
git remote -v | grep "$username"
if [ $? -ne 0 ]; then
project=`git ls-remote --get-url | sed 's/.*\/\([a-z]*\).git/\1/g'`
git remote add "$username" "https://github.com/$username/$project.git"
fi
git fetch "$username"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment