GitHub Please use a personal access token instead.

今天把本地项目的一个组件库分享上传到github上, 突然就出现了警告,

 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/Nevergive-up/HJProgress.git/'

远程:密码验证的支持在 2021 年 8 月 13 日被删除。请使用个人访问令牌。
遥控器:请看 https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ 了解更多信息。
致命:身份验证失败'https://github.com/Nevergive-up/HJProgress.git/'

1、personal access token(个人访问令牌)设置方法

1.1登录到github上,点击设置

在这里插入图片描述

1.2在左边的设置中找到 Developer settings(开发者设置)

点击左边

1.3 找到 Personal access tokens(个人访问令牌)

在这里插入图片描述

然后点击生成就ok了,把生成的码记录下来(我这边已经生成,暂不截图展示了)

2 添加 Person access token

2.1 在终端打开,输入 vim .git/config

2.2 里面大致内容如下

此处是没有修改的内容

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[remote "origin"]
        url = https://github.com/Nevergive-up/HJProgress.git
        fetch = +refs/heads/*:refs/remotes/origin/*  

然后将你项目的 token 放到 url 中,替换成如下(按 i 进行编辑):

url=https:// 你的 [email protected]/Nevergive-up/HJProgress.git

token 后面要有个 @符号!!!

完成后就按:,输入 wq 保存,然后退出。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/u014651417/article/details/124426326