hexo-deployer-git icon indicating copy to clipboard operation
hexo-deployer-git copied to clipboard

deployer ignores user's name & email specified in _config.yml deploy/name and deploy/email

Open desmond-dsouza opened this issue 7 years ago • 4 comments

I do not have global git user-name & user-email configured, but I do have this in my _config.yml:

deploy:
  type: git
  repo: [email protected]:desmond-dsouza/blog.git
  branch: gh-pages
  message: "update blog"
  name: Desmond
  email: <my email>

However, each time I run hexo deploy I get this message:

Committer: desmond <[email protected]>
Your name and email address were configured automatically based
on your username and hostname.

The commit gets done using that incorrect name & email. Is this a bug?

I checked in .deploy_git and its .git/config does not contain any user name or email. It appears like these lines https://github.com/hexojs/hexo-deployer-git/blob/master/lib/deployer.js#L73-L75 are supposed to add those to the .git/config.

desmond-dsouza avatar Oct 23 '18 19:10 desmond-dsouza

Is it true that if the deployer runs once and creates .deploy_git and some initial contents, it will not subsequently process (possibly new) information from _config.yml?

If so, that would explain what happened with me. I did not have the name and email fields set up initially, then when I added them later and they seemed to have no effect.

desmond-dsouza avatar Oct 23 '18 20:10 desmond-dsouza

I meet the same situation as you .Here's my solution. If you update name and email in _config.yml later or you already have .deploy_git on your root, then you should delete .deploy_git and redeploy it, after that your config changes will take effect.

Kuro-P avatar Dec 02 '18 15:12 Kuro-P

I meet the same situation as you .Here's my solution. If you update name and email in _config.yml later or you already have .deploy_git on your root, then you should delete .deploy_git and redeploy it, after that your config changes will take effect.

It works. Nice solution.

VegetaPn avatar Jan 11 '19 06:01 VegetaPn

I meet the same situation as you .Here's my solution. If you update name and email in _config.yml later or you already have .deploy_git on your root, then you should delete .deploy_git and redeploy it, after that your config changes will take effect.

It works, thanks. By the way, redeployment will overwrite the commits hexo has pushed before.

shisaru292 avatar Jul 12 '21 05:07 shisaru292