# Automatically setup remote tracking for new branches
$ git config --global push.default current
# Make local repository current branch exactly like remote
$ currentBranch=git rev-parse --abbrev-ref HEAD
$ git fetch && git reset --hard origin/$currentBranch && git pull origin $currentBranch
Last active
August 18, 2017 20:48
-
-
Save githubnando/a68ff19725e984d22d29a58c5f4c6dc4 to your computer and use it in GitHub Desktop.
Alias for automatically setup tracking for origin in new branches and other useful git commands
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment