解决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的服务器也不错。平时没有优惠,有需要的学习党或者前端工作党,赶紧冲起来优惠地址可以参考这个传送大门

相关推荐
CozyOct13 小时前
⚡️2025-11-19GitHub日榜Top5|30秒部署热点助手
github
Zzz 小生4 小时前
Github-Go语言AI智能体开发套件:构建下一代智能代理的利器
人工智能·golang·github
正经教主5 小时前
【Git】Git05-03:Github身份验证方式PAT和SSH
git·github
逛逛GitHub7 小时前
推荐 3 个 AI 智能体 GitHub 项目,太绝了啊。
github
Empty_7778 小时前
Ansible变量
服务器·github·ansible
CoderJia程序员甲16 小时前
GitHub 热榜项目 - 日榜(2025-11-15)
ai·开源·大模型·github·ai教程
rainboy1 天前
Flutter :自己动手,封装一个小巧精致的气泡弹窗库
前端·flutter·github
Ace_31750887761 天前
拼多多商品详情接口深度解析:从加密参数破解到数据全量获取
前端·数据库·github
CLTHREE1 天前
GitHub项目协作完整指南:从Fork到本地开发
github
小鱼小鱼.oO1 天前
GitHub Actions 和 GitLab CI/CD
ci/cd·gitlab·github