This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Sets up auto-tracking of a remote branch with same base name. | |
# Can set up "git track" so it feels built-in: | |
# git config --global --add alias.track '!git-track' | |
# | |
branch=$(git branch 2>/dev/null | grep ^\*) | |
[ x$1 != x ] && tracking=$1 || tracking=${branch/* /} | |
git config branch.$tracking.remote origin |
NewerOlder