blog迁移

前言

  • 要换电脑,迁移下blog,感觉有些东西还是要写出来才有点感觉

git配置

  • 环境该下的下载好,blog文件可以直接拖拽到另一台电脑上就行
  • 下面就是配置git 的ssh key,连接github blog仓库
1
2
3
4
5
6
git config --global user.name "Shmily-ing"    #仓库名


git config --global user.email "xxxxxx@qq.com"

ssh-keygen -t rsa -C xxxxxx@qq.com” #默认位置就行 ,会生成公私钥
  • id_rsa.pub 添加到github

image-20220614005502831

1
2
3
4
5
6
7
8
9
10
11
C:\Users\shmilying>git init
Initialized empty Git repository in C:/Users/shmilying/.git/

C:\Users\shmilying>ssh -T git@github.com
ssh: connect to host github.com port 22: Connection refused

C:\Users\shmilying>git remote add origin git@github.com:Shmily-ing/Shmily-ing.github.io.git

C:\Users\shmilying>git remote -v
origin git@github.com:Shmily-ing/Shmily-ing.github.io.git (fetch)
origin git@github.com:Shmily-ing/Shmily-ing.github.io.git (push)

然后在git bash里面输入

1
ssh -T git@github.com

报错解决

(28条消息) Windows下解决ssh: connect to host github.com port 22: Connection refused_Sososoby的博客-CSDN博客

我用的方法三,完美解决

1
2
3
4
5
6
Host github.com
User xxxxxx9@qq.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile C:/Users/shmilying/.ssh/id_rsa
Port 443
1
Hi Shmily-ing! You've successfully authenticated, but GitHub does not provide shell access.

然后就hexo命令和之前一样。

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2020-2023 Shmily-ing
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信