From 7393fb41eddd9d1799dcf02c4ea82da466bac876 Mon Sep 17 00:00:00 2001 From: Orestis Date: Thu, 13 Sep 2018 15:15:03 +0300 Subject: [PATCH] git-rename-branch: Don't fail if remote doesn't exist Allows the command to work correctly with local branches. Closes #535 --- bin/git-rename-branch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-rename-branch b/bin/git-rename-branch index b0a0769..9416d61 100755 --- a/bin/git-rename-branch +++ b/bin/git-rename-branch @@ -6,7 +6,7 @@ test -z $1 && echo "new branch name required." 1>&2 && exit 1 new_branch="$1" old_branch="${2-$(git symbolic-ref --short -q HEAD)}" -remote=$(git config branch."$old_branch".remote) +remote=$(git config branch."$old_branch".remote; true) git branch -m "$old_branch" "$new_branch" # check if the branch is tracking a remote branch