Last active
May 10, 2023 14:39
-
-
Save benjamincharity/e7d09f90e26a1ec75ae549470f340116 to your computer and use it in GitHub Desktop.
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 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
[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