From 42b748e863a3ecd199e16bb0dead902242d3e43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Buscht=C3=B6ns?= Date: Thu, 17 Dec 2020 17:42:49 +0100 Subject: [PATCH] fix: `pull --rebase` before `push` --- lib/git.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/git.js b/lib/git.js index 0b3bc22..9eda87f 100644 --- a/lib/git.js +++ b/lib/git.js @@ -81,7 +81,10 @@ function replaceTree(targetDir, ourDir, commitMessage) { } function push(targetDir, repo, branch) { - return run("git", ["push", repo, branch], { cwd: targetDir }); + return run("git", ["pull", "--rebase", repo, branch], { cwd: targetDir }) + .then(function () { + return run("git", ["push", repo, branch], { cwd: targetDir }); + }); } function origin(targetDir) {