[Docusaurus Error] Running git push command failed. Does the GitHub user account you are using have push access to the repository?



user@user % GIT_USER=[USERNAME] yarn deploy

yarn run v1.22.17
$ docusaurus deploy
[WARNING] When deploying to GitHub Pages, it is better to use an explicit "trailingSlash" site config.
Otherwise, GitHub Pages will add an extra trailing slash to your site urls only on direct-access (not when navigation) with a server redirect.
This behavior can have SEO impacts and create relative link issues.

[INFO] Deploy command invoked...
[INFO] organizationName: user
[INFO] projectName: docusaurus
[INFO] deploymentBranch: gh-pages
[INFO] Remote repo URL: https://user@github.com/user/docusaurus.git
bkdkejrworiwjreorkjsdf
[INFO] `git rev-parse HEAD` code: 0
[INFO] [en] Creating an optimized production build... 

(....)

[INFO] `git commit -m "Deploy website - based on bkdkejrworiwjreorkjsdf"` code: 0
Password for 'https://userdomain@github.com': 
remote: Repository not found.
fatal: repository 'https://github.com/user/docusaurus.git/' not found
[INFO] `git push --force origin gh-pages` code: 128
[ERROR] Running "git push" command failed. Does the GitHub user account you are using have push access to the repository?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

We can see this issue when we use Docusaurus. In my case, this issue made by config option. When i use deploy, this makes problem. I solve this problem like under.

const config = {
  title: 'title',
  tagline: 'tagline',
  url: 'http://url',
  baseUrl: '/',
  favicon: 'img/logo.png',

  organizationName: 'user', // Usually your GitHub org/user name.

  projectName: 'user', // Usually your repo name.
}

If you see this problem, you have to see organizationName. If this information is wrong, Docusaurus makes error. If you have problem, try confirm this!