nucliweb
9/11/2015 - 5:59 PM

Some simple scripts I use to manage open source branches

Some simple scripts I use to manage open source branches

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

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.