Created
September 12, 2013 16:26
-
-
Save agazso/6540294 to your computer and use it in GitHub Desktop.
Git update repository with stashing local changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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