unixorn/git-extra-commands

View on GitHub
bin/git-track

Summary

Maintainability
Test Coverage
#!/bin/sh
#
# Sets up your branch to track a remote branch. Assumes you mean
# `origin/$branch-name`.

branch=$(git rev-parse --abbrev-ref HEAD)
exec git branch "$branch" --set-upstream-to "origin/$branch"