Skip to content

Instantly share code, notes, and snippets.

@joshuaclayton
Forked from sstephenson/git-track
Created November 26, 2008 03:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshuaclayton/29261 to your computer and use it in GitHub Desktop.
Save joshuaclayton/29261 to your computer and use it in GitHub Desktop.
#!/bin/sh
branch=$(git branch 2>/dev/null | grep ^\*)
[ x$1 != x ] && tracking=$1 || tracking=${branch/* /}
git config branch.$tracking.remote origin
git config branch.$tracking.merge refs/heads/$tracking
echo "tracking origin/$tracking"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment