From 3d0fe69fdf2edb7c5b363711990f2d638cbc9ae7 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 27 Oct 2017 03:50:13 +0300 Subject: [PATCH] Fix(fork): Add remote origin if it doesn't exist in an existing repo --- fork | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" && -- 2.39.5