hexojs / hexo-deployer-git

Git deployer plugin for Hexo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying the source files via `hexo-deployer-git`

cmp0xff opened this issue · comments

Check List

Please check followings before submitting a new issue.

  • I have already read Docs page & Troubleshooting page
  • I have already searched existing issues and they are not help to me
  • I examined error or warning messages and it's difficult to solve
  • Using the latest version of Hexo (run hexo version to check)
  • Node.js is higher than 8.6.0

Question

I would like to deploy the source files to an additional src branch so that I can maintain my website on different machines. I was basically following this answer on Stackoverflow. However, I got problem with permissions of a specific file. Only if I run $ hexo deploy with root privilege can I deploy the source successfully.

I cannot write a comment on Stackoverflow because I do not have sufficient reputation there. Also the person who wrote the answer seems not to be active since months ago.

Environment & Settings

Node.js & npm version

v13.8.0
6.13.7

Your site _config.yml (Optional)

deploy:
  - type: git
    repo: git@github.com:<username>/<username>.github.io.git
    branch: master
  - type: git
    repo: git@github.com:<username>/<username>.github.io.git
    branch: src
    extend_dirs: /
    ignore_hidden: false
    ignore_pattern:
        public: .

Your theme _config.yml (Optional)

Hexo and Plugin version(npm ls --depth 0)

hexo-site@0.0.0 <local repo path>/<username>/<username>.github.io
├── hexo@4.2.0
├── hexo-deployer-git@2.1.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-index@1.0.0
├── hexo-generator-tag@1.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-stylus@1.1.0
└── hexo-server@1.0.0

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "hexo": "^4.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0"
  }
}

Others

If I run $ hexo deploy without root privilege, the error message reads

FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: EACCES: permission denied, copyfile '<local repo path>/<username>/<username>.github.io/.git/objects/06/3b27d8a4076d6f0748228cea43ffd963678206' -> '<local repo path>/<username>/<username>.github.io/.deploy_git/.git/objects/06/3b27d8a4076d6f0748228cea43ffd963678206'