Skip to content

Instantly share code, notes, and snippets.

@mschultheiss83
Forked from sstephenson/git-track
Created February 13, 2013 16:23
Show Gist options
  • Save mschultheiss83/4945783 to your computer and use it in GitHub Desktop.
Save mschultheiss83/4945783 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