Skip to content

Instantly share code, notes, and snippets.

@putermancer
Created October 13, 2010 05:42
Show Gist options
  • Save putermancer/623526 to your computer and use it in GitHub Desktop.
Save putermancer/623526 to your computer and use it in GitHub Desktop.
# git track alias - easily set up a remote-tracking branch
[alias]
track = "!sh -c '[ $# = 2 ] && git branch --track \"$1\" \"$2\" && exit 0 || [ $# = 1 ] && git branch --track \"$1\" origin/\"$1\" && exit 0 || echo \"usage: git track <branch> [remote_branch] \\n\\nIf remote branch is not specified, the default is to use origin/<branch>\" && exit 1' -"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment