From: Oleg Broytman Date: Wed, 11 Oct 2017 21:47:50 +0000 (+0300) Subject: Feat(fork): Check .git in the current directory X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=4402fd2c33d3df3eede8ecd8b36807e9f2d7b409;p=git-scripts.git Feat(fork): Check .git in the current directory --- diff --git a/fork b/fork index 2c8d82a..2f032d5 100755 --- a/fork +++ b/fork @@ -10,7 +10,10 @@ origin="$2" local_repo="`basename \"$origin\" .git`" if [ -d "$local_repo"/.git ]; then - cd "$local_repo" && + cd "$local_repo" +fi && + +if [ -d .git ]; then git remote add upstream "$upstream" && git remote set-url origin "$origin" else