背景

试图完成在 Deepin 上的 hexo 更新与上传

步骤

1、安装 Git

参考

https://git-scm.com/download/linux

image-20231108215422422

对于 Deepin 系统,我使用这个命令

1
apt-get install git

配置 git

git config username

1
2
3
git config --global user.name "用户名"
git config --global user.email "邮箱"

2、安装 nodejs 和 npm

参考

https://blog.csdn.net/fengjinghong/article/details/122923587

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# 安装更新Node.js和Npm所需要的软件
echo "update apt packge ..."
sudo apt update
# 添加NodeSource APT存储库和用于验证软件包的PGP密钥
echo "add NodeSource APT is PGP"
sudo apt install apt-transport-https curl ca-certificates software-properties-common
echo "add apt-get nodejs16.x and PGP" # 该行命令完成了apt-get存储库的添加并添加了PGP密钥
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
echo "install nodejs and npm...." # 安装Node
sudo apt-get install -y nodejs

3、安装 pandoc

参考

https://blog.csdn.net/weixin_44375591/article/details/104005570

1
sudo apt-get install pandoc

4、安装 picGo

https://github.com/Molunerfinn/PicGo/releases

选择Applmage后缀的版本

下载完双击运行程序并配置

5、安装 Typroa

参考

https://blog.csdn.net/weixin_42905141/article/details/124071137

1
2
3
4
5
6
7
tar xzvf Typora-linux-x64.tar.gz 
cd bin
sudo cp -ar Typora-linux-x64 /opt
cd /opt/Typora-linux-x64/
#启动
./Typora

6、添加 rsa 密钥

1
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

7、部署 hexo

1
npm install -g hexo-cli

问题

git ·push 时出现问题

1
fatal:Authentication failed for‘https://git ...

原因:

github 政策改变,在填写 password 时要使用 token

https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

image-20231108223535267

但是使用 https 协议每次都要输入 token

改为 ssh 传输

参考

https://blog.csdn.net/qq_41726670/article/details/124389683

查看现在使用什么协议传输

1
2
3
4
git remote -v
origin https://github.com/用户名/仓库 (fetch)
origin https://github.com/用户名/仓库 (push)

可以看出来使用了 https 协议

修改为 ssh 传输(前提事先生成 ssh 密钥)

1
2
git remote set-url origin git@github.com:用户名/仓库  

5 、Typroa linux

6、PicGo linux

备用地址| Center-cr's Blog (zoujiaitic.top)