Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created July 19, 2013 12:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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