部署本地博客到gitee

部署本地博客到gitee

  1. 打开到blog文件夹

    1
    2
    git config --global user.name "刘翔升"
    git config --global user.email "756680474@qq.com"

    image-20230814165551483

  2. 运行代码

    1
    ssh-keygen -t rsa -C "756680474@qq.com"

    需要回车3次,image-20230814165628628

  3. 运行代码,以获取密钥

    1
    cat ~/.ssh/id_rsa.pub

    image-20230814170534268

  4. 在gitee创建SSH公钥

    复制上面的公钥,放入页面image-20230814170503003

  5. 测试是否设置成功

    1
    ssh -T git@gitee.com

    image-20230814165909419

  6. 修改配置文件 _config.yml

    1
    2
    3
    4
    5
    # Deployment
    ## Docs: https://hexo.io/docs/one-command-deployment
    deploy:
    type: 'git'
    repository: git@gitee.com:lxiangsheng147/lxiangsheng147.git

    image-20230814170003422

  7. 完成最后的部署

    1
    npm install hexo-deployer-git --save

    image-20230814170056131

  8. hexo上传到gitee

    1
    2
    3
    4
    5
    6
    7
    8
    hexo clean
    # 清理网页
    hexo g
    # 生成网页
    hexo s
    # 预览网页
    hexo d
    # 上传到gitee

    image-20230814170303952

  9. 更新下gitee内容

    image-20230814170611506

    更新下就好!

参考视频