From 1875dde8b986af5c9c0829744d111e6e606421ff Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 14 Aug 2020 18:13:11 +0300 Subject: [PATCH] Feat(hooks/post-update): Add remote `origin` if not exists --- hooks/post-update | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.2