From: Oleg Broytman Date: Fri, 14 Aug 2020 15:13:11 +0000 (+0300) Subject: Feat(hooks/post-update): Add remote `origin` if not exists X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=1875dde8b986af5c9c0829744d111e6e606421ff;p=git-scripts.git Feat(hooks/post-update): Add remote `origin` if not exists --- diff --git a/hooks/post-update b/hooks/post-update index 45de97e..62e3b0f 100755 --- a/hooks/post-update +++ b/hooks/post-update @@ -6,6 +6,9 @@ for ref in "$@"; do if [ "$ref" = refs/heads/master ]; then unset GIT_DIR cd ../git-scripts && - exec git pull ../git-scripts.git master + if ! git remote show -n origin 2>/dev/null; then + git remote add origin ../git-scripts.git + fi && + exec git pull origin master fi done