Merge pull request #729 from orestisf1993/patch-1

git-rename-branch: Don't fail if remote doesn't exist
This commit is contained in:
罗泽轩 2018-09-13 22:29:07 +08:00 committed by GitHub
commit 8b992cc9bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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