关于github提交失败的问题

问题描述

Username for 'https://github.com': LAL-Better
Password for 'https://LAL-Better@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/LAL-Better/funny-project.git/'

在这里插入图片描述

解决办法

1. 安装git权限管理工具gcm

本机使Ubuntu,其它操作系统可以参考: gcm 安装指南
Ubuntu 操作步骤

sudo dpkg -i gcm-linux_amd64.2.4.1.deb
  • 运行配置命令
git-credential-manager configure
  • 使用gpg保管密钥
git config --global credential.credentialStore gpg
  • 如果没有gpg key则生成一个
gpg --generate-key

结果中包含以下信息

pub   rsa3072 2024-03-29 [SC] [expires: 2026-03-29]
      22C64B88AC6606C857C34749E8C64B191B3815ED
uid                      deg1wx <mingliang.deng@cn.bosch.com>
sub   rsa3072 2024-03-29 [E] [expires: 2026-03-29]
  • 最后,记住pub 后的一串字符(公钥)然后执行以下命令
pass init 22C64B88AC6606C857C34749E8C64B191B3815ED

如果没有pass命令,则使用sudo apt install pass安装。

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-30 11:18:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-30 11:18:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-30 11:18:03       82 阅读
  4. Python语言-面向对象

    2024-03-30 11:18:03       91 阅读

热门阅读

  1. 深入探索C++对象模型(二)

    2024-03-30 11:18:03       39 阅读
  2. Spring的IoC(控制反转)和 DI(依赖注入)

    2024-03-30 11:18:03       42 阅读
  3. c++数字和字符串的转化

    2024-03-30 11:18:03       36 阅读
  4. git实战教程

    2024-03-30 11:18:03       40 阅读
  5. 【物联网】 Qinghub http-connector 连接协议

    2024-03-30 11:18:03       35 阅读
  6. typescript——3.接口

    2024-03-30 11:18:03       36 阅读
  7. 手写SpringBoot(四)之bean动态加载

    2024-03-30 11:18:03       46 阅读
  8. vue2完结

    2024-03-30 11:18:03       30 阅读
  9. pytorch yolov5+Deepsort实现目标检测和跟踪+单目测距

    2024-03-30 11:18:03       43 阅读
  10. LertCode263.丑数

    2024-03-30 11:18:03       39 阅读
  11. Docker部署oracle快捷版

    2024-03-30 11:18:03       38 阅读