Skip to content

Instantly share code, notes, and snippets.

@leongaban
Last active January 4, 2018 22:46
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 leongaban/368ee69d1acedde3df757daa87bdbf6a to your computer and use it in GitHub Desktop.
Save leongaban/368ee69d1acedde3df757daa87bdbf6a to your computer and use it in GitHub Desktop.
git update-using
update-using = "!f(){ CUR_BRANCH=$(git rev-parse --abbrev-ref HEAD); git checkout "$1" && git pull && git push --no-verify origin "$1":"$1" && git checkout $CUR_BRANCH && git rebase "$1"; }; f"
# 1) Grabs the name of the branch you're on
# 2) Checks out the REL branch you specified
# 3) Updates the REL branch from upstream
# 4) Hydrates the REL branch on origin
# 5) Checks out your feature branch again [from step 1]
# 6) Begins rebasing REL onto your feature branch
# Set upstream branch
# git branch --set-upstream-to upstream/REL_ENUDDEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment