如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
A5资源网32 分钟前
cloudflare配合github搭建免费开源影视LibreTV一个独享视频网站 详细教程
github
mortimer1 小时前
从零到一:构建一个 Chatterbox-TTS API 服务
开源·github·ai编程
Tipriest_1 小时前
Ubuntu常用的软件格式deb, rpm, dmg, AppImage等打包及使用方法
linux·运维·ubuntu
真智AI1 小时前
利用 Claude Opus 4 自动化 GitHub 工作流:从安装到实战详解
运维·自动化·github
胡斌附体2 小时前
linux测试端口是否可被外部访问
linux·运维·服务器·python·测试·端口测试·临时服务器
愚润求学2 小时前
【Linux】自旋锁和读写锁
linux·运维
大锦终2 小时前
【Linux】常用基本指令
linux·运维·服务器·centos
知北游天3 小时前
Linux:多线程---深入互斥&&浅谈同步
linux·运维·服务器
Gappsong8743 小时前
【Linux学习】Linux安装并配置Redis
java·linux·运维·网络安全
try2find3 小时前
移动conda虚拟环境的安装目录
linux·运维·conda