Replies: 1 comment
-
|
Yes — you can deploy Docusaurus to GitHub Pages without using The key point is:
❌ Why your current approach failsYou tried: export GIT_USER=...
git config user.name ...
git config user.email ...But Docusaurus’ deploy script ultimately runs: git commitAnd Git requires one of these to be set in the current repo context:
If neither is properly set, Git throws an error. ✅ Correct solution (NO global config needed)✔ Option 1 — set local git config (best practice)Run this inside your repo: git config user.name "Your Name"
git config user.email "you@example.com"This writes to: ✔ No global config required ✔ Option 2 — inline config during deploy (CI-friendly)You can bypass both global + manual config using: git -c user.name="Your Name" \
-c user.email="you@example.com" \
commit -m "deploy"But Docusaurus deploy script doesn’t expose this directly, so this is mainly for custom scripts. ✔ Option 3 — use environment variables correctlyDocusaurus expects: GIT_USER=your-usernameBUT: 👉 This only affects authentication (push access), NOT commit identity. So you still must set: git config user.name
git config user.emaillocally or in CI.
|
| Method | Works? |
|---|---|
git config --global |
❌ not required |
git config user.* (local) |
✅ best |
| CI git config | ✅ best for automation |
only GIT_USER |
❌ not enough |
🚀 Final answer
👉 You don’t need global git config
👉 But you MUST set local repo identity or CI identity
If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find.
Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting.
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Somewhat of a discussion in #1771, but I was wondering if anyone has been able to deploy to
gh-pageswithout setting a global git config. I am trying this, but have not had any luck yet.I am even setting
{user}:{key}for theGIT_USERenvironment variable, and tried setting them in a.gitconfigfile, but the deploy script still wants global git config.Beta Was this translation helpful? Give feedback.
All reactions