Last active
February 15, 2024 10:18
-
-
Save danott/6001537 to your computer and use it in GitHub Desktop.
Create a fresh staging branch from the latest deployed master.
This file contains 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/bash | |
# | |
# Assumptions: | |
# - Clean working tree. | |
# - Tags are used exclusively to tag deploys | |
git checkout master | |
git branch -D staging # Delete staging branch locally. | |
git push origin :staging # Delete staging branch from GitHub. | |
git checkout -b staging `git describe --abbrev=0 --tags` # create staging from the latest deployed tag. | |
git push --set-upstream origin staging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment