如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
用户2217659279214 分钟前
python第三方库可以处理多线程请求接口结果顺序问题?
github
努力努力再努力wz17 分钟前
【Linux进阶系列】:线程(下)
linux·运维·服务器·c语言·数据结构·c++·算法
KV_T21 分钟前
centos运维常用命令
linux·运维·centos
todoitbo30 分钟前
使用n8n搭建服务器监控系统:从Webhook到Telegram告警的完整实现
运维·服务器·数据库·ai·向量数据库·流处理·n8n
dessler30 分钟前
MYSQL-主键(Primary Key)
linux·运维·mysql
CoderJia程序员甲36 分钟前
GitHub 热榜项目 - 日榜(2025-11-11)
ai·开源·大模型·github·ai教程
lkbhua莱克瓦2441 分钟前
Java入门——Java跨平台的原理
java·开发语言·笔记·github
安丘贾队长1 小时前
json啊啊啊啊啊啊啊啊啊
运维
我什么都学不会1 小时前
DNS主从服务器练习
linux·运维·服务器
zt1985q1 小时前
外网访问项目研发管理软件 codes
运维·服务器·windows·网络协议·tcp/ip