Added function to delete a git branch from local, cached remote and remote server

This commit is contained in:
Nathan Broadbent
2012-02-22 11:28:48 +08:00
parent 5d46601889
commit c68f0c523a

View File

@@ -103,7 +103,7 @@ git_submodule_rm() {
# i.e. swap origin <-> username # i.e. swap origin <-> username
git_swap_remotes() { git_swap_remotes() {
if [ -z "$2" ]; then if [ -z "$2" ]; then
echo "Usage: $0 remote1 remote2" echo "Usage: git_swap_remotes remote1 remote2"
return return
fi fi
git remote rename "$1" "$1_temp" git remote rename "$1" "$1_temp"
@@ -117,6 +117,18 @@ if [ "$shell" = "bash" ]; then
fi 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 # Updates cached Travis CI status if repo contains .travis.yml
# #
# Creates and excludes .travis_status~ # Creates and excludes .travis_status~