美文网首页
github 使用access token认证

github 使用access token认证

作者: help_youself | 来源:发表于2023-01-26 15:30 被阅读0次

 我有一段时间,没有向github推代码。今天使用access token向github推代码的时候,总是提示The requested URL returned error: 403。
 之前我按照博客[1]d的参考,用起来是没有错误的。后来,按照博客[2],在生成access token时,勾选workflow。这样,终于将代码推到gituhb,大概花了三个小时。github可能对access token的使用范围增加了权限。比如,只有勾选workflow,用户才能push代码。
 完成后,推代码命令:

git clone https://user_name:access_token@github.com/user_name/project-name.git
git add -A
git commit -m "say something"
git remote set-url origin  https://user_name:access_token@github.com/user_name/project-name.git
git push

git remote set-url配置后,可以在.git/config中查看到信息:

vi .git/config

Reference:
[1]github 配置使用 personal access token 认证
[2]解决git push报错:The requested URL returned error: 403

相关文章

网友评论

      本文标题:github 使用access token认证

      本文链接:https://www.haomeiwen.com/subject/jccshdtx.html