From: Oleg Broytman Date: Sat, 11 Jan 2025 21:48:49 +0000 (+0300) Subject: Feat(fork): Set URL for `upstream` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=d0376cf544046b41edccdafdedadd87679b9eed2;p=git-scripts.git Feat(fork): Set URL for `upstream` --- diff --git a/fork b/fork index cbf5d9a..7238ada 100755 --- a/fork +++ b/fork @@ -15,8 +15,10 @@ 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 origin "$origin" + git remote add upstream "$upstream" || + git remote set-url upstream "$upstream" + git remote set-url origin "$origin" || + git remote add origin "$origin" else git clone -o upstream "$upstream" "$local_repo" && cd "$local_repo" &&