Last active
October 28, 2019 15:12
-
-
Save seanmhanson/2ff2ef0be5fdc7e9e8e25c2c965c2f03 to your computer and use it in GitHub Desktop.
Git Command to stash changes, pull master, and open a new branch
This file contains 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 | |
if ! git diff-index --quiet HEAD --; then | |
echo 'Uncommitted local changes detected. Stashing...' | |
git stash | |
fi | |
echo 'Pulling Master' | |
git checkout master | |
git pull origin master | |
# I prefix with mongoDB project, but do whatever you want | |
echo 'Creating New Branch' | |
git checkout -b "CLOUDP-${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment