Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 13 lines (7 sloc) 334 Bytes
#!/bin/sh
# Based on an alias written by doener on #git.
# usage: git retrack REMOTE URL BRANCH
branch=$(git rev-parse --symbolic-full-name HEAD | sed 's/refs\/heads\///')
git remote add -f $1 "$2" || echo But that\'s perfectly OK.
git config branch.$branch.remote "$1"
git config branch.$branch.merge "refs/heads/${3:-$branch}"