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) {