Last active
June 2, 2025 16:54
-
-
Save jonathands/fa9a80f0958c4bc46c10aa4b651273ca to your computer and use it in GitHub Desktop.
merge a feature branch and get back
This file contains hidden or 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
| # On ~/.bashrc or equivalent | |
| # usage | |
| # gmergehml tries to merge current branch and gets back | |
| # gmergehml name/ofbranch specify a branch | |
| gmergehml() { | |
| local feature_branch="${1:-$(git rev-parse --abbrev-ref HEAD)}" | |
| read -p "Merge branch '$feature_branch' into 'homolog'? [y/N] " answer | |
| case "$answer" in | |
| [Yy]* ) | |
| git checkout homolog \ | |
| && git merge "$feature_branch" \ | |
| && git push \ | |
| && git checkout "$feature_branch" | |
| ;; | |
| * ) | |
| echo "Merge aborted." | |
| ;; | |
| esac | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment