fatal: could not read Username for ‘https://github.com‘: Invalid argument
Hexo g -d
but get the error like below
fatal: could not read Username for 'https://github.com': Invalid argument
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
The way to solve it is by two steps
1.go to the blog/_config.yml update the url like
deploy:
type: git
repo: git@github.com:zengyanzi/zengyanzi.github.io.git
branch: master
Instead of https://github.com/zengyanzi/zengyanzi.github.io
- Generate ssh as below :
A- Create a ssh key using Git Bash using following command
ssh-keygen -t rsa -b 4096 -C "zengzhen.ucf@email.com"
After running this command just install the by default options and enter the password balnk when it prompts.(Three times of pressing space)
B- Then run the following commands to locate the public/private key generated from step1
cd .ssh
cd ~/.ssh
3- Then run the following command to view your public:
cat id_rsa.pub
4- Copy your public key and go to your GitHub account -> settings -> create a SSH and GPG keys then click new ssh key and past your public key in the in key text field.
5- Verify your public key using Git Bash by running the following command:
ssh -vT git@github.com
You will get output like this
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3848, received 2040 bytes, in 0.2 seconds
Bytes per second: sent 16032.4, received 8499.5
debug1: Exit status 1
Then you no longer got “could not read Username for ‘https://github.com‘: Invalid argument”