I’ve ran into a problem recently while deploying my HEXO blog to GitHub.
First, I have two GitHub account, and I want to push one blog folder to one account and another folder to another account.
But somehow, I can’t deploy it because it use my number 1 account for number two folder.
I’ve already add ssh-key to the second GitHub account.
change the local git account
1 | git config --local user.name "hexo-theme-last" |
change the global git account
1 | git config --global user.name "hexo-theme-last" |
Set the email and user in _config.yml
file in blog root directory.
1 | deploy: |
deploy with pamaraters
1 | hexo d -u hexo-theme-last -e xxx@xx.com |
The weird things is that no matter how I change, it will still use my first account to deploy.
And then I test the ssh connection, create a config
file in .ssh
directory
1 | Host github2 |
And then I run this command, it works well.
1 | $ ssh -T github2 |
But if I run this, it will use the first account ssh as default.
1 | $ ssh -T git@github.com |
Because I want to test whether is only hexo using old account or git using old account, I pushed the original code to the second GitHub account(hexo-theme-last).
Then I realize it need a personal access token
Finally, I solve this problem by using personal access token
in hexo _config.yml
file.
1 | deploy: |