Skip to content

Instantly share code, notes, and snippets.

@KidkArolis
Last active October 10, 2015 22:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KidkArolis/56edcc5e91004833d2df to your computer and use it in GitHub Desktop.
Save KidkArolis/56edcc5e91004833d2df to your computer and use it in GitHub Desktop.
Update local repo after merging a PR
# add this to your ~/.bash_profile or similar
# say you're on a branch `my-feature` and
# you merge the PR for that branch on GitHub
# you can now execute `gu` to run the following
gu () {
branch=$(git symbolic-ref --short HEAD)
git checkout master
git pull
git remote prune origin
git branch -d $branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment