From 4402fd2c33d3df3eede8ecd8b36807e9f2d7b409 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 12 Oct 2017 00:47:50 +0300 Subject: [PATCH] Feat(fork): Check .git in the current directory --- fork | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5