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

相关推荐
wflynn2 小时前
GitHub 今日推荐|univer:可嵌入 Web 应用的开源 Office 引擎
typescript·开源·github·doc·collaboration·board
dong_junshuai2 小时前
每天一个开源项目#163 Ghost Downloader:分块下载为何不用合并
github
网易云信2 小时前
AI 写 IM 集成总用错 API?用云信 AI Skills 把文档接进开发流程
github
猛码象限3 小时前
【GitHub 周报】换血八成,注意力从造 Agent 转向管 Agent
github·业界资讯
逛逛GitHub3 小时前
很多人想把《GTA 6》移植到 PC 上,这 4 个 GitHub 项目在努力。
github
逛逛GitHub4 小时前
谷歌 Chrome 团队出手了,GitHub 上获 1W 的 Star 了。
github
秋千易8 小时前
评测通过率 0.5,阈值一改就绿:跑分器先写三种退出码
github
答案answer8 小时前
从0-1在高德地图上搭建一个智慧仓库数字孪生场景
github
徐小夕9 小时前
折腾一年,我们正式发布 JitOffice:一款跑在浏览器里的 AI Office
前端·vue.js·github
zhensherlock1 天前
Protocol Launcher 系列:CodeHub 移动端 GitHub 协作利器
前端·javascript·typescript·node.js·自动化·github·js