{"record":{"id":"a634d3aeaf50a5aa","repo":"facebook/docusaurus","slug":"please-set-the-git-user-environment-variable-or-e","errorCode":null,"errorMessage":"Please set the GIT_USER environment variable, or explicitly specify USE_SSH instead!","messagePattern":"Please set the GIT_USER environment variable, or explicitly specify USE_SSH instead!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/commands/deploy.ts","lineNumber":128,"sourceCode":"    exec('git rev-parse --abbrev-ref HEAD', {\n      log: false,\n      failfast: true,\n    })\n      ?.stdout?.toString()\n      .trim();\n\n  const gitUser = process.env.GIT_USER;\n\n  let useSSH =\n    process.env.USE_SSH !== undefined &&\n    process.env.USE_SSH.toLowerCase() === 'true';\n\n  if (!gitUser && !useSSH) {\n    // If USE_SSH is unspecified: try inferring from repo URL\n    if (process.env.USE_SSH === undefined && hasSSHProtocol(sourceRepoUrl)) {\n      useSSH = true;\n    } else {\n      throw new Error(\n        'Please set the GIT_USER environment variable, or explicitly specify USE_SSH instead!',\n      );\n    }\n  }\n\n  const organizationName =\n    process.env.ORGANIZATION_NAME ??\n    process.env.CIRCLE_PROJECT_USERNAME ??\n    siteConfig.organizationName;\n  if (!organizationName) {\n    throw new Error(\n      `Missing project organization name. Did you forget to define \"organizationName\" in ${siteConfigPath}? You may also export it via the ORGANIZATION_NAME environment variable.`,\n    );\n  }\n  logger.info`organizationName: name=${organizationName}`;\n\n  const projectName =\n    process.env.PROJECT_NAME ??","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/commands/deploy.ts#L110-L146","documentation":"Thrown by deploy when neither GIT_USER nor USE_SSH=true is set and the source remote URL is not SSH-protocol (so SSH cannot be inferred). Docusaurus needs one of these to push the build to the gh-pages branch: HTTPS deploys require GIT_USER, SSH deploys require USE_SSH=true or an SSH remote URL.","triggerScenarios":"Running deploy with an HTTPS origin remote, GIT_USER unset, and USE_SSH unset/false. The inference fallback only triggers when USE_SSH is undefined AND the remote URL already uses SSH; otherwise this error fires.","commonSituations":"First-time deploy setup, CI (GitHub Actions) where GIT_USER is not exported, or accidentally setting USE_SSH=false explicitly instead of leaving it unset for inference.","solutions":["For HTTPS: `export GIT_USER=<your-github-username>` then re-run.","For SSH: `export USE_SSH=true` (or rely on an SSH origin remote with USE_SSH unset).","In GitHub Actions, set GIT_USER (often `${{ github.actor }}`) in the deploy step env.","Avoid setting USE_SSH=false explicitly if you want SSH inference from the remote URL."],"exampleFix":"# before\ndocusaurus deploy  # HTTPS origin, no GIT_USER, no USE_SSH\n# after\nexport GIT_USER=octocat\ndocusaurus deploy","handlingStrategy":"validation","validationCode":"const hasGitUser = Boolean(process.env.GIT_USER);\nconst useSSH = process.env.USE_SSH?.toLowerCase() === 'true';\nif (!hasGitUser && !useSSH) {\n  throw new Error('Set GIT_USER or USE_SSH=true before deploying.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always export GIT_USER (or USE_SSH=true) in your deploy environment.","In GitHub Actions, set GIT_USER to `${{ github.actor }}`.","Do not set USE_SSH=false explicitly if you want SSH inference from the remote URL."],"tags":["deploy","git","env","auth","github-pages"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}