解决github无法克隆私有仓库,Repository not found问题(2024最新)

一、背景

这个问题出现,是你用了其他主机设备,需要重新clone私有库时,发现一直报找不到仓库,如下报错:

powershell 复制代码
remote: Repository not found.

二、解决方法

(1)账号密码方式(已不支持,不推荐)

之前有个解决方法,通过HTTP协议克隆时,加上账号密码,如:

powershell 复制代码
git clone https://用户名:密码@github.com/用户名/仓库.git

但是这个方法已经不行了,GitHub已经在2021年8月13号开始不支持这种方式clone仓库。你就会见到下面这个报错:

powershell 复制代码
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.

(2)Token方式(推荐!!!)

所以,可以通过Token的方式进行克隆私有仓库。

powershell 复制代码
git clone http://token名字:token的值@github.com/用户名/仓库.git

创建access token的方法:

进入GitHub的Settings > Developer Settings > Personal Access Token > Generate New Token > 勾选需要的功能, 正常选上repo就够了. > 点击 Generate token 就行了

另外,先立即复制保存你的Token,因为关闭之后,就无法在查看Token。


总结

出现这个问题,主要是刚买了个99的阿里的服务器,然后在服务器拉取私有仓库,本地开发私有仓库时发生。 如果你需要学习服务器相关知识,整一个2核2G的一年才99的服务器也不错。平时没有优惠,有需要的学习党或者前端工作党,赶紧冲起来 ,优惠地址可以参考这个 :传送大门

相关推荐
sbjdhjd6 小时前
从签名重放到 Agent Harness:一堂安全课程如何把前端逆向、MCP 与工程约束串起来
网络安全·ai·github·agent·webshell·mcp·harness
逛逛GitHub8 小时前
火了两周的 30 万 Star 逆向 GitHub 开源神器,网友都用它来干啥?
github
wflynn9 小时前
GitHub 日榜趋势速报 | 2026-10-18
开源·github
疯狂敲代码的老刘10 小时前
d2r-mobile:3.2千星开源暗黑破坏神2 iOS兼容层,3天冲上GitHub日榜
ios·github
高频因子挖掘机10 小时前
多股票行情为什么容易对不齐?用 Pandas MultiIndex 管理标的、日期与缺失值
后端·github·api
miofly10 小时前
GitHub 日榜趋势速报 | 2026-10-19
开源·github
高频因子挖掘机10 小时前
Python 量化数据接口设计实战:用数据契约解决字段混乱与回测不一致
后端·github·api
u13013019 小时前
GitHub 热榜项目:日榜(2026-10-17)
人工智能·github
51ai1 天前
学生用 AI 做了个 AI Agent:453 测试全过,求大佬说句真话——它算玩具还是工具?
github
_肆云1 天前
GitHub CI/CD 全流程
ci/cd·github