Compare commits

..

4 Commits

Author SHA1 Message Date
Marcin Woźniak
e35def944a Resolved confict 2021-12-12 22:05:59 +01:00
34cedc26e2 Merge branch 'master' of git.yorune.pl:y0rune/myhome
Signed-off-by: Marcin Woźniak <marcin.wozniak@wundermanthompson.com>
2021-12-12 22:04:39 +01:00
Marcin Woźniak
591c60ff05 Changes replace with leader + s 2021-12-10 12:00:40 +01:00
40a1728698 Added git-branch-delete
Signed-off-by: Marcin Woźniak <marcin.wozniak@wundermanthompson.com>
2021-12-02 13:10:31 +01:00

27
.local/bin/git-delete-branch Executable file
View 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