Skip to content

Instantly share code, notes, and snippets.

@andypotanin
Created May 9, 2016 10:45
Show Gist options
  • Save andypotanin/5c9b7096fd9ec7deb1c2295cc369f412 to your computer and use it in GitHub Desktop.
Save andypotanin/5c9b7096fd9ec7deb1c2295cc369f412 to your computer and use it in GitHub Desktop.
Add this to your binary path to deploy things into "latest" branch quickly.
#!/usr/bin/env bash
## Deploy branch into "develop" branch
##
## Save Original Branch
ORIGINAL_BRANCH=$(git symbolic-ref --short HEAD)
echo "Deploying [${ORIGINAL_BRANCH}] into [latest]."
## Checkout target branch "develop"
git checkout latest
## Pull down develop branch
git pull
## Merge our original branch into the develop branch
git merge origin/$ORIGINAL_BRANCH
## Push to develop
git push
## Checkout our original branch again
git checkout ${ORIGINAL_BRANCH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment