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,可以点击查看详情

未完待续~~~

相关推荐
峰向AI10 小时前
还在手动配 SSL 证书?这个 75K Star 的 Web 服务器让 HTTPS 自动到起飞
github
Java陈序员10 小时前
轻量运维面板!一款现代化的服务器控制面板工具!
运维·服务器·python·react.js·github
u13013013 小时前
GitHub 热榜项目:日榜(2026-09-10)
github
用户21368637835214 小时前
给 DeepSeek Harness 写了个「技能熔炉」:任何来源的 SKILL.md 一条命令装上
github
七牛开发者15 小时前
告别反复调参,一个 Skill 让 AI 掌握论文图的视觉语法:以 DeepSeek V4.1 Flash 论文图为例
github·agent·deepseek
简创AIGC陶先生15 小时前
【直播切片工作台】第11章:剪辑项目模型 VideoProject
github
MicrosoftReactor15 小时前
技术速递|如何在不牺牲任务质量的前提下,让 AI 编码更具成本效益
人工智能·ai·github·copilot
中科三方16 小时前
DNS拨测到底在拨测什么?
开发语言·github·php·dns·云拨测
digital-Yun20 小时前
Harness 深度图解
github
码流怪侠1 天前
Sunshine 深度拆解:当 NVIDIA GameStream 闭源后,如何用 4 万颗 Star 重建自托管云游戏
游戏·github·nvidia