如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
面包狗AI4S30 分钟前
GitHub AI4S 项目观察(2026-08-07—2026-08-13)
人工智能·github
华科大胡子1 小时前
GitHub Actions自动化运维实战技术文章大纲
github
fthux1 小时前
装闭 RenoPit 源码解析(14):Demo模式、健康检查与Docker部署
人工智能·ai·开源·github·open source·renopit
TunerT_TQ2 小时前
Meta React 源码静态评测:从 4540 个源文件看 React Compiler 的工程化演进
meta·开源·github
峰向AI3 小时前
再也不怕换工具失忆了:它给 AI 编程助手装上"长期记忆"
github
lsh曙光3 小时前
playbook剧本(2)--Ansible变量
linux·运维·网络
ly76894 小时前
Docker 从入门到实践:镜像、容器、Dockerfile 与 Docker Compose 详解
运维·docker·容器
tokenKe4 小时前
AirLLM:一张 4GB 显卡,把 70B 模型“流“起来 |SSP Github Daily
github
用户3169353811834 小时前
ry.bat和ry.sh部署
运维
mennekes5 小时前
自动化产线临时配电:明装工业插座 vs 面板式工业插座 vs 模块化插座箱取舍
运维·科技·安全·制造