Skip to content

Instantly share code, notes, and snippets.

@rdj
Created May 11, 2011 16:18
Show Gist options
  • Select an option

  • Save rdj/966787 to your computer and use it in GitHub Desktop.

Select an option

Save rdj/966787 to your computer and use it in GitHub Desktop.
[alias]
up = "!rdj_git_up() { if [[ -z `git status --porcelain` ]]; then local back=$(git name-rev --name-only HEAD); echo ======== fetch origin ========; git fetch origin && for r in devel master; do echo ======== fast-forward $r ========; git checkout $r && git merge --ff-only origin/$r; done && now=$(git name-rev --name-only HEAD); [[ $now != $back ]] && echo ======== checkout $back ======== && git checkout $back; else echo Repo is not clean; fi }; rdj_git_up"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment