Home > front end >  I have question when creating blog with github
I have question when creating blog with github

Time:10-31

When I run hexo d in Git Bash It jumped out :


fatal: repository 'https://github.com/rippleQAQ/rippleQAQ.github.io.git/' not found
FATAL {
  err: Error: Spawn failed
      at ChildProcess.<anonymous> (C:\Users\HCC\Desktop\blog\myblog\node_modules\hexo-util\lib\spawn.js:51:21)
      at ChildProcess.emit (node:events:513:28)
      at cp.emit (C:\Users\HCC\Desktop\blog\myblog\node_modules\cross-spawn\lib\enoent.js:34:29)
      at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
    code: 128
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

rippleQAQ is my github name,and I've created a repository named rippleQAQ.github.io and SSH key

my _config.yml is:

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://github.com/rippleQAQ/rippleQAQ.github.io.git
  branch: master

I need some help.Thank you.

I tried delete and recreate my github repository again and again.And change _config.yml.But it was no use.

CodePudding user response:

As described in Hexo: GitHub Pages, if you go the Project page route (as opposed to GitHub Action), you would need to:

  1. Navigate to your repo on GitHub. Go to the Settings tab. Change the Repository name so your blog is available at username.github.io/repository, repository can be any name, like blog or hexo.
  2. Edit your _config.yml, change the url: value to https://username.github.io/repository.
  3. Commit and push to the default branch.
  4. Once the deployment is finished, the generated pages can be found in the gh-pages branch of your repository.
  5. In your GitHub repo’s setting, navigate to Settings > Pages > Source. Change the branch to gh-pages and save.
  6. Check the webpage at username.github.io/repository.

Meaning: you need to manually add, commit and push your code, to the main branch (not master, since oct. 2020)

And your _config.yml should use the gh-pages branch.

deploy:
  type: git
  repo: https://github.com/<username>/<project>
  # example, https://github.com/hexojs/hexojs.github.io
  branch: gh-pages
  • Related