Last active
May 10, 2023 14:39
Star
You must be signed in to star a gist
Git alias function to delete local AND remote branch(s). NOTE: If dealing with branches that are not fully merged, the `-d` would need to change to `-D`.
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
[alias] | |
deletebranch = "!f() { \ | |
git push origin --delete "$@"; \ | |
git branch -d "$@"; \ | |
}; f" | |
# usage: | |
# git deletebranch my-branch | |
# git deletebranch branch-1 branch-2 branch-3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment