Skip to content

Instantly share code, notes, and snippets.

@asselstine
Last active April 3, 2020 12:12
Show Gist options
  • Save asselstine/5b75f5765fbee9cb71de32e0116b8c7e to your computer and use it in GitHub Desktop.
Save asselstine/5b75f5765fbee9cb71de32e0116b8c7e to your computer and use it in GitHub Desktop.
hotfix workflow
# My Heroku git production remote is called 'production'
git remote -v
# Yields:
#
# origin git@github.com:Loft47/loft.git (fetch)
# origin git@github.com:Loft47/loft.git (push)
# production https://git.heroku.com/loft47-prod.git (fetch)
# production https://git.heroku.com/loft47-prod.git (push)
# staging https://git.heroku.com/vey-staging.git (fetch)
# staging https://git.heroku.com/vey-staging.git (push)
# First fetch the remote branches from production so that you're up-to-date
git fetch production
# Checkout a new branch based off the Heroku production master branch
git checkout -b bug/something -t production/master
# Do your work, then commit it
git add .
git commit -m 'My hotfix changes'
# Push directly to heroku
git push production bug/something:master
# Merge new commits into master
git checkout master
git merge bug/something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment