1、hexo初始化博客
这里主要有两个命令,一个是npm install -g hexo-cli,这个命令能碰到的的问题主要是卡住,建议下载一个淘宝镜像
第二个是hexo init,这里的问题整整卡了我两天,我的报错是(fatal: unable to access …)解决方法:首先我们可以去添加三条新的环境变量,添加万这三条以后去博客根目录里hexobush并再次输入命令,问题基本解决,如果还不行的话,可以去cmd里再次输入。
001
2、hexo d命令
该命令意思是讲你的本地文件夹上传到github上,解决方法是查看你的根目录配置文件,翻到最下面查看branch后的代码,如果是march请将它改为main,具体原因好像是因为github最近讲march分支改为了main分支。如果还未解决的话可能是因为你的repository设置有问题(还是根目录配置文件的最底层)这里我们放置的链接必须是ssh链接,如下图,因为我们是通过ssh与github获得连接的,所以使用https的形式会报错。
002

3、git clone命令
使用该命令时报错 fatal: remote error: You can’t push to git,解决方法参考下面的文章
https://xvideos.blog.csdn.net/article/details/52367128
大概意思是由于我们与github建立的是ssh连接,而我们在git clone时并没有通过ssh的方式去获得连接如一下报错
fatal: remote error:
You can’t push to git://github.com/user_name/user_repo.git
Use git@github.com:user_name/user_repo.git
这里我们只需要使用以下代码就可以了
$ git remote rm origin
$ git remote add origin git@github.com:user_name/user_repo.git