如何在服务器上克隆、pull、push GitHub私有项目

诸神缄默不语-个人CSDN博文目录

情况是这样的,我直接用git clone命令后,会提示让我输入GitHub账号密码,我输入后它还是显示克隆失败,并显示:

复制代码
Cloning into 'folder_name'...
Username for 'https://github.com': user_name
Password for 'https://user_name@github.com': 
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.
fatal: Authentication failed for 'https://github.com/user_name/folder_name.git/'

也就是说现在不支持仅用账号密码来克隆GitHub项目了,解决方案是在输入密码时改为输入personal access token。获取personal access token的方式:

  1. 进入https://github.com/settings/personal-access-tokens/new
  2. 创建personal access token:选择项目范围接下来选择操作范围,我就选了能commit、pull request之类的功能,因为感觉也不需要别的功能。
  3. 生成personal access token后点击这个图标即可复制:
相关推荐
wangruofeng9 小时前
7.1 万 Star 的 MinerU,把 PDF 变成 LLM 能读懂的 Markdown
github
wangruofeng9 小时前
75k Star 的 OCR 传奇——Tesseract 的 40 年,从 HP 实验室到 LSTM 神经网络
github
阿里云大数据AI技术11 小时前
阿里云 EMR AI 助手正式发布:从问答工具到全栈智能运维助手
运维·人工智能
逛逛GitHub12 小时前
又挖到 3 个不错的 GitHub 项目,尤其是第 2 个。
github
逛逛GitHub12 小时前
GitHub 上 13 万星的爬虫神器,不要 API Key 就能用了。
github
一点一木19 小时前
🚀 2026 年 6 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
SkyWalking中文站1 天前
认识 Horizon UI · 6/17:Trace 探索器
运维·监控·自动化运维
火车叼位2 天前
写给初级开发者:SSL、SSH、HTTPS 与证书体系全解析
运维
OpenTiny社区2 天前
从零开发 AI 聊天页要两周?试试这款 Vue3 垂直对话组件库 TinyRobot,直接开箱即用
前端·vue.js·github
逛逛GitHub2 天前
2 万多 Star!Google 开源了这个神级 GitHub 项目。
github