Git推送到GitHub仓库遇到的问题

问题一

问题:

GitHub 从 2021 年 8 月 13 日起,就不再支持使用账号密码进行 Git 操作了,必须使用个人访问令牌(Personal Access Token, PAT)来代替

类似报错如下:

19:43:23.011: first_item git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:refs/heads/master --set-upstream

remote: Invalid username or token. Password authentication is not supported for Git operations.

fatal: Authentication failed for 'https://github.com/jige4836/Pet-System.git/'

Token生成步骤

1.点击头像

2.选择Settings

进入Settings后,滑动左侧边栏到底部,点击Developer settings

1.确保进入Developer settings

2.点击Personal access tokens

注:操作过程中,需要进行验证,可以使用GitHub手机App验证

1.点击tokens(classis)

2.点击Generate new token

3.选择第二个Generate new token(classis)

1.名称Note

2.有效期限Expiration(可以以月为单位,但是别设置太长时间)

3.仓库权限repo(建议授予仓库所有权限)

提交后就可以看到tokens,复制后可以直接当密码用

退出后,就会显示token,可以点击查看详情

未完待续~~~

相关推荐
青 春 记 忆6 小时前
零基础入门Python11|Git实战:为任务管理器建立版本历史
开发语言·git·vscode·python·python3.11
牢姐与蒯8 小时前
Linux基础开发工具之版本控制器git
git
面包狗AI4S10 小时前
GitHub AI4S 项目观察(2026-08-07—2026-08-13)
人工智能·github
华科大胡子10 小时前
GitHub Actions自动化运维实战技术文章大纲
github
云原生指北11 小时前
Docker Sandboxes 工作区怎么接:Direct、Clone 和它们的边界
git·docker·agent
fthux11 小时前
装闭 RenoPit 源码解析(14):Demo模式、健康检查与Docker部署
人工智能·ai·开源·github·open source·renopit
TunerT_TQ11 小时前
Meta React 源码静态评测:从 4540 个源文件看 React Compiler 的工程化演进
meta·开源·github
峰向AI12 小时前
再也不怕换工具失忆了:它给 AI 编程助手装上"长期记忆"
github
菠萝猫yena12 小时前
【git】git 命令常用组合
大数据·git·elasticsearch
tokenKe13 小时前
AirLLM:一张 4GB 显卡,把 70B 模型“流“起来 |SSP Github Daily
github