Created
May 24, 2019 00:47
-
-
Save dmpe/f9ea6fd8caa2ba494057aff915dd211d to your computer and use it in GitHub Desktop.
delete remote and locale devel-cur-* branch
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
# https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely | |
release_in_question="9.0.3.290.02" | |
future_release="" | |
git checkout master | |
# get latest from remote | |
git pull origin pull | |
# start with remotes: delete remote branch named devel-cur-* | |
#git push origin --delete --force $(git branch -r --list 'devel-cur-*') | |
git push origin --delete --force "devel-cur-$release_in_question" | |
# 1. rename local branch to a different name, will become protected branch | |
git branch -m "devel-cur-$release_in_question" "prod-'$release_in_question'" | |
# push this newly renamed branch to gitlab | |
git push origin "prod-'$release_in_question'":"prod-'$release_in_question'" | |
# 2. rename next release to become devel-cur | |
git branch -m "devel-$future_release" "devel-cur-'$future_release'" | |
# push this newly renamed branch to gitlab | |
git push origin "devel-cur-'$future_release'":"devel-cur-'$future_release'" | |
# use below to checkout init-file branch and start new release from there | |
git checkout -b "devel-$future_release" dev | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment