Compare commits
4 Commits
15f37be93f
...
e35def944a
Author | SHA1 | Date | |
---|---|---|---|
|
e35def944a | ||
34cedc26e2 | |||
|
591c60ff05 | ||
40a1728698 |
27
.local/bin/git-delete-branch
Executable file
27
.local/bin/git-delete-branch
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# shellcheck disable=2162
|
||||||
|
|
||||||
|
function delete_local_branch(){
|
||||||
|
git branch -D "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_remote_branch(){
|
||||||
|
git push origin --delete "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "List of branches:"
|
||||||
|
echo -e "$(git branch)"
|
||||||
|
echo
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -p "Select branch to remove: " BRANCH
|
||||||
|
read -p "Remove locally / remote / both [L/R/B]: " CHOOSE
|
||||||
|
case $CHOOSE in
|
||||||
|
[Bb]* ) delete_local_branch "$BRANCH" && delete_remote_branch "$BRANCH" ;;
|
||||||
|
[Ll]* ) delete_local_BRANCH "$BRANCH";;
|
||||||
|
[Rr]* ) delete_remote_BRANCH "$BRANCH";;
|
||||||
|
* ) echo "Please write good answer";;
|
||||||
|
esac
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user