如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
粟悟饭&龟波功30 分钟前
【GitHub热门项目精选】(2025-12-19)
前端·人工智能·后端·github
_F_y1 小时前
Linux:多线程
linux·运维·服务器
BullSmall2 小时前
集群-节点的概念
运维
vortex52 小时前
Linux 命令行入门:命令的构成与选项用法
linux·运维·服务器
天勤量化大唯粉2 小时前
枢轴点反转策略在铜期货中的量化应用指南(附天勤量化代码)
ide·python·算法·机器学习·github·开源软件·程序员创富
m0_474606782 小时前
Linux安装docker教程
linux·运维·docker
CoderJia程序员甲2 小时前
GitHub 热榜项目 - 日榜(2025-12-19)
ai·开源·llm·github
落霞的思绪2 小时前
Mybatis读取PostGIS生成矢量瓦片实现大数据量图层的“快显”
linux·运维·mybatis·gis
像风一样的男人@3 小时前
linux --防火墙
linux·运维·服务器
小明_GLC3 小时前
关于Pycharm中导入github项目,出现依赖包报错
github