Skip to content

Instantly share code, notes, and snippets.

@dgiunta
Forked from sstephenson/git-track
Created January 26, 2010 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgiunta/287341 to your computer and use it in GitHub Desktop.
Save dgiunta/287341 to your computer and use it in GitHub Desktop.
git-track
#!/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