From c68f0c523a7eba85d305e41c3288b4daac7c7942 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Wed, 22 Feb 2012 11:28:48 +0800 Subject: [PATCH] Added function to delete a git branch from local, cached remote and remote server --- lib/git/tools.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/git/tools.sh b/lib/git/tools.sh index e481b36..074b1ec 100644 --- a/lib/git/tools.sh +++ b/lib/git/tools.sh @@ -103,7 +103,7 @@ git_submodule_rm() { # i.e. swap origin <-> username git_swap_remotes() { if [ -z "$2" ]; then - echo "Usage: $0 remote1 remote2" + echo "Usage: git_swap_remotes remote1 remote2" return fi git remote rename "$1" "$1_temp" @@ -117,6 +117,18 @@ if [ "$shell" = "bash" ]; then fi +# Delete a git branch from local, cached remote and remote server +git_branch_delete_all() { + if [ -z "$1" ]; then + echo "Usage: git_branch_delete_all branch" + return + fi + git branch -D $1 + git branch -D -r origin/$1 + git push origin :$1 +} + + # Updates cached Travis CI status if repo contains .travis.yml # # Creates and excludes .travis_status~