Skip to content

Instantly share code, notes, and snippets.

@wittawasw
Last active July 15, 2024 04:56
Show Gist options
  • Save wittawasw/ca726cf24bf54aeae1537516ace0577a to your computer and use it in GitHub Desktop.
Save wittawasw/ca726cf24bf54aeae1537516ace0577a to your computer and use it in GitHub Desktop.
# merge branch into main, develop then tag and push all.
ghf () {
# hotfix/{VERSION}
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
git checkout develop
git merge $BRANCH_NAME
git checkout main
git merge $BRANCH_NAME
VERSION = $(echo $BRANCH_NAME | cut -d'/' -f2)
git tag -a {VERSION}
git push --all
}
# remove merged branches
gbdm() {
g branch | grep -v "main" | xargs git branch -D
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment