Created
May 7, 2018 05:48
-
-
Save 8parth/6df54db2bf931b4b2e61ecd3922cae69 to your computer and use it in GitHub Desktop.
git and heroku helper scripts
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 | |
| cd $PWD | |
| echo $1 | |
| if [ -d .git ]; then | |
| if [ -z "$1" ]; then | |
| echo "checking out $(git symbolic-ref --short -q HEAD) ..." | |
| else | |
| echo "Checkout to $1 ..." | |
| git fetch && git checkout $1 | |
| fi; | |
| current_branch="$(git symbolic-ref --short -q HEAD)" | |
| echo "Current Branch is [ $current_branch ]" | |
| if [ $current_branch = 'develop' ]; then | |
| echo "on develop branch" | |
| else | |
| echo $current_branch | |
| echo "checkout develop" | |
| git checkout develop | |
| git pull origin develop | |
| echo "delete $current_branch" | |
| git branch -d $current_branch | |
| git push origin --delete $current_branch | |
| fi; | |
| else | |
| echo "Not a git directory" | |
| fi; |
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 | |
| cd $PWD | |
| git checkout develop | |
| git pull origin develop | |
| git push heroku develop:master | |
| heroku run rails db:migrate -r heroku | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment