Custom git script for use with git based deployment
We use CI for git workflow deployments. Here's a handy script to not take you away from what you're working on.
Put this into a file called git-deploy somewhere in your $PATH and make it executable.
#!/bin/bash
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo 'currently on' $BRANCH
echo 'co and pull master'
git checkout master
git pull --ff-only
echo 'co and pull production'
git checkout production
git pull --ff-only
echo 'merge and push'
git merge master
git push
echo 'switching back to' $BRANCH
git checkout $BRANCH
now you can run this like any other git command
$ git deploy
Written by Jon Druse
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#