git config --global user.name "xxx"
git config --global user.email "xxx@qq.com"
ssh-keygen -t rsa -C "xxx@qq.com"
cat .ssh/id_rsa.pub
之后将这坨代码粘贴到github里面的setting中
ssh -T git@github.com
参考资料:https://www.jianshu.com/p/7edb6b838a2e
add:git add --all
提交代码:git commit -m "xxx"
将提交的内容push到仓库:git push -u origin master
查看当前分支:git branch
按分支进行克隆:git clone -b hexo httpxxxx.git
只输入一次github密码:git config --global credential.helper store
(参考自:https://blog.csdn.net/ds19980228/article/details/83720450)
https://pages.github.com/
放弃本地所有修改: git checkout .
git报错ssh: connect to host github.com port 22: Connection timed out
解决方案(亲测有效)
Host github.com
User YourEmail(你的邮箱)
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
再次执行
ssh -T git@github.com
会出现以下提示,输入yes回车即可
The authenticity of host '[ssh.github.com]:443 ([192.30.255.123]:443)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.255.123]:443' (RSA) to the list of known hosts.
参考资料:https://blog.csdn.net/hdm314/article/details/119947761
参考资料:git放弃本地文件修改