Skip to content

Instantly share code, notes, and snippets.

@dmpe
Created May 24, 2019 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmpe/f9ea6fd8caa2ba494057aff915dd211d to your computer and use it in GitHub Desktop.
Save dmpe/f9ea6fd8caa2ba494057aff915dd211d to your computer and use it in GitHub Desktop.
delete remote and locale devel-cur-* branch
# 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