Skip to content

Instantly share code, notes, and snippets.

@spikeheap
Last active October 8, 2015 08:31
Show Gist options
  • Select an option

  • Save spikeheap/5aa5ff5429c8014b77fe to your computer and use it in GitHub Desktop.

Select an option

Save spikeheap/5aa5ff5429c8014b77fe to your computer and use it in GitHub Desktop.
Git Flow start the day

Add this function to your ZSH/BASH init to do a sane update of develop and master. Handy when you come back to a project after a couple of days.

Note that this doesn't merge develop into your current branch, but I'll leave that to you to add if you need it :).

# Add to .profile, .bashrc, .zshrc, etc.
function gitup() {
TMP_INITIAL_BRANCH=`git rev-parse --abbrev-ref HEAD`
git co master && git pull
git co develop && git pull
git co ${TMP_INITIAL_BRANCH}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment