This plugin deploys source of your Hexo site, not static files generated. Pushing your source to repository is difference with deploying. So I don't recommand using this plugin for your Hexo site. This is just for practice.
$ npm install https://github.com/kcopper8/hexo-source-deployer-git --save
You can configure this plugin in _config.yml
deploy:
- type: source-git
repository: <repository url>
branch: [branch]
- repository: Repository URL
- branch: Git branch to deploy the source file to
When you deploy your Hexo site, hexo-source-deployer-git add, commits and push
using spawn
in hexo-util. All commands are invoked
on Hexo base_dir. You can see more information in the Hexo API document.
It is same as running the next commands on your base_dir.
$ git add -A
$ git commit --allow-empty-message -m ''
$ git push -u <repository url> branch
If your Hexo base_dir is not initialized by Git, hexo-source-deployer-git
will initialize your base_dir. It is same as next commands.
$ git init
MIT