Skip to content

Instantly share code, notes, and snippets.

@wulab
Last active August 29, 2015 14:10
Show Gist options
  • Save wulab/4fef80464723c71b36ba to your computer and use it in GitHub Desktop.
Save wulab/4fef80464723c71b36ba to your computer and use it in GitHub Desktop.
A way to get hotfix branch to master when staging has pending commits
# backup current staging
$ git checkout staging
$ git branch tmp
# reset to master and merge hotfix
$ git reset --hard master
$ git merge hotfix/xxx
$ git push --force origin staging
# deploy to production
$ git checkout master
$ git merge staging
$ git push origin master
# merge back previous staging
$ git checkout staging
$ git merge tmp
$ git push origin staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment