From 9852c86807ebae1cb1161d047667b807b5bc7556 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 10 Nov 2020 02:36:41 +0100 Subject: [PATCH 1/2] allow to push into remote, even if brach does not exist --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b673545..ee1554d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -48,4 +48,4 @@ git status git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE" echo "Pushing git commit" -git push origin "$TARGET_BRANCH" +git push origin -u "$TARGET_BRANCH" From edbe7a0efcb6a864332880f670655a7cef3ad356 Mon Sep 17 00:00:00 2001 From: Carles Pina Estany Date: Tue, 10 Nov 2020 08:59:28 +0000 Subject: [PATCH 2/2] Use long command option instead of short and adds comment Thanks @TomasVotruba --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index ee1554d..7ecb558 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -48,4 +48,5 @@ git status git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE" echo "Pushing git commit" -git push origin -u "$TARGET_BRANCH" +# --set-upstream: sets de branch when pushing to a remote empty repository +git push origin --set-upstream "$TARGET_BRANCH"