From aee5834c8aa184710ed636a531dcf3931d68bcbb Mon Sep 17 00:00:00 2001 From: endiliey Date: Tue, 30 Apr 2019 22:13:04 +0800 Subject: [PATCH] fix(v2): deploy script should force push --- packages/docusaurus/lib/commands/deploy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/lib/commands/deploy.js b/packages/docusaurus/lib/commands/deploy.js index bc52f6d585..ade37ab342 100644 --- a/packages/docusaurus/lib/commands/deploy.js +++ b/packages/docusaurus/lib/commands/deploy.js @@ -164,7 +164,9 @@ module.exports = async function deploy(siteDir) { const commitResults = shell.exec( `git commit -m "${commitMessage}" -m "Deploy website version based on ${currentCommit}"`, ); - if (shell.exec(`git push origin ${deploymentBranch}`).code !== 0) { + if ( + shell.exec(`git push --force origin ${deploymentBranch}`).code !== 0 + ) { throw new Error('Error: Git push failed'); } else if (commitResults.code === 0) { // The commit might return a non-zero value when site is up to date.