Skip to content

Instantly share code, notes, and snippets.

@agazso
Created September 12, 2013 16:26
Show Gist options
  • Select an option

  • Save agazso/6540294 to your computer and use it in GitHub Desktop.

Select an option

Save agazso/6540294 to your computer and use it in GitHub Desktop.
Git update repository with stashing local changes
#!/bin/sh
set -e
status=$(git status -s -uno)
[ "$status" != "" ] && git stash
git pull --rebase
[ "$status" != "" ] && git stash pop
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment