From: Oleg Broytman Date: Fri, 27 Oct 2017 00:50:13 +0000 (+0300) Subject: Fix(fork): Add remote origin if it doesn't exist in an existing repo X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=3d0fe69fdf2edb7c5b363711990f2d638cbc9ae7;p=git-scripts.git Fix(fork): Add remote origin if it doesn't exist in an existing repo --- diff --git a/fork b/fork index 146cde4..7782b89 100755 --- a/fork +++ b/fork @@ -14,8 +14,8 @@ if [ -d "$local_repo"/.git ]; then fi && if [ -d .git ]; then - git remote add upstream "$upstream" && - git remote set-url origin "$origin" + git remote add upstream "$upstream" + git remote set-url origin "$origin" || git remote add origin "$origin" else git clone -o upstream "$upstream" "$local_repo" && cd "$local_repo" &&