]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(fork): Set URL for `upstream`
authorOleg Broytman <phd@phdru.name>
Sat, 11 Jan 2025 21:48:49 +0000 (00:48 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 11 Jan 2025 21:48:49 +0000 (00:48 +0300)
fork

diff --git a/fork b/fork
index cbf5d9a8571ccc4bd0c851cc3aba0de76fd361db..7238adaca2037ecf4db99d95d362302e2ee054b2 100755 (executable)
--- 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" &&