Skip to content

Instantly share code, notes, and snippets.

@yoeun
Last active December 9, 2019 16:59
Show Gist options
  • Save yoeun/c0b95f42a8e264a8074795ccdf744b7f to your computer and use it in GitHub Desktop.
Save yoeun/c0b95f42a8e264a8074795ccdf744b7f to your computer and use it in GitHub Desktop.
Updates all local branches to latest upstream
git for-each-ref --shell --format="if [[ %(refname:short) != \"_ignore\"* ]] && [[ ! -z %(upstream) ]]; then git checkout %(refname:short) && git rebase %(upstream:short); fi" refs/heads/ | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment