如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
Dovis(誓平步青云)3 分钟前
《简易制作 Linux Shell:详细分析原理、设计与实践》
linux·运维·服务器
爱宇阳19 分钟前
Linux 教程:如何查看服务器当前目录中的文件
linux·运维·github
wheeldown24 分钟前
【Linux】Linux 进程通信:System V 共享内存(最快方案)C++ 封装实战 + 通信案例,4 类经典 Bug 快速修复
linux·运维·服务器·开发语言
CoderJia程序员甲1 小时前
GitHub 热榜项目 - 日榜(2025-10-17)
ai·llm·github·开源项目·github热榜
绝无仅有1 小时前
面试真实经历某商银行大厂数据库MYSQL问题和答案总结(一)
后端·面试·github
绝无仅有1 小时前
Docker 实战经验之关键文件误删恢复指南
后端·面试·github
AORO20251 小时前
防爆手机与普通手机有什么区别?防爆手机哪个牌子好?
运维·服务器·网络·5g·智能手机·信息与通信
爱倒腾的老唐1 小时前
29、构建可视化日志管理服务器
运维·服务器
Sirens.2 小时前
Java核心概念:抽象类、接口、Object类深度剖析
java·开发语言·github
dessler2 小时前
Elasticsearch(ES)-Logstash
linux·运维·elasticsearch