Skip to content

Instantly share code, notes, and snippets.

@nzakas
Created September 11, 2015 17:59
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzakas/c6c98856a5eac76f06e3 to your computer and use it in GitHub Desktop.
Save nzakas/c6c98856a5eac76f06e3 to your computer and use it in GitHub Desktop.
Some simple scripts I use to manage open source branches

Usage:

To create a new branch that is up-to-date with the remote master:

$ ws 123

Creates the branch issue123

To finish up after the change has been merged:

$ wd 123

This switches to master, deletes the local branch issue123, and deletes the remote branch issue123.

workstart(){
git fetch origin
git checkout -b "issue$1" origin/master
}
workdone() {
git checkout master
git branch -D "issue$1"
git push origin :"issue$1"
}
alias ws=workstart
alias wd=workdone
@jdcargile
Copy link

Awesome! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment