Skip to content

Instantly share code, notes, and snippets.

@octylFractal
Last active September 14, 2017 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octylFractal/d20ef01c6d2d38716d8be7a05d2ac29e to your computer and use it in GitHub Desktop.
Save octylFractal/d20ef01c6d2d38716d8be7a05d2ac29e to your computer and use it in GitHub Desktop.
Re-master your branch: pull latest master and rebase upon it.
#!/usr/bin/env bash
set -e
master="$1"
if [[ "$master" == "" ]]; then master=master; fi
current_branch="$(git name-rev --name-only HEAD)"
set -x
git checkout "$master"
git pull
git checkout "$current_branch"
git rebase "$master"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment