Skip to content

Commit 2199b35

Browse files
committed
Enable deleting remote branch
1 parent cf64804 commit 2199b35

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git-delete-branch-interactive.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ git_delete_interactive() {
9999
echo "Selected branch: $selected_branch"
100100

101101
remote_branch_info="$(__gdi_get_info_remote_branch $selected_branch)"
102-
echo "remote branch info: $remote_branch_info"
103102
if [ -n "$remote_branch_info" ]
104103
then
105104
remote_branch_name="$(echo $remote_branch_info | cut -d' ' -f1)"
@@ -108,15 +107,15 @@ git_delete_interactive() {
108107
if [ $up_to_date_with_remote = true ]
109108
then
110109
echo "Deleting remote branch $remote_branch_name"
111-
# git push --delete "$(echo $remote_branch_name | sed 's|/| |')"
110+
git push --delete $(echo $remote_branch_name | sed 's|/| |')
112111
else
113112
echo "Remote branch $remote_branch_name is not up-to-date with the local tracking branch $selected_branch"
114113
echo -n "Delete it anyway? [y/n] "
115114
read delete_anyway
116115
if [[ "$delete_anyway" =~ [yY] ]]
117116
then
118117
echo "Deleting remote branch $remote_branch_name"
119-
# git push --delete "$(echo $remote_branch_name | sed 's|/| |')"
118+
git push --delete $(echo $remote_branch_name | sed 's|/| |')
120119
else
121120
echo "Not deleting remote branch $remote_branch_name"
122121
fi
@@ -130,11 +129,12 @@ git_delete_interactive() {
130129
else
131130
echo -n "Delete local branch $selected_branch (the last copy of the work)? [y/N] "
132131
read delete_local_branch
133-
echo "answer: $delete_local_branch"
134132
if [[ "$delete_local_branch" =~ [yY] ]]
135133
then
136134
echo "Deleting local branch $selected_branch"
137135
git branch -D $selected_branch
136+
else
137+
echo "Not deleting local branch $selected_branch"
138138
fi
139139
fi
140140
fi

0 commit comments

Comments
 (0)