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~