如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
我叫洋洋12 小时前
涂鸦 T5+ hashcat 自动化破解 WPA2:从单缺 M2 到全自动值守的踩坑实录 破解wifi 密码
运维·单片机·自动化
꯭自꯭闭꯭19 小时前
达梦SQL优化相关
linux·运维·数据库·sql
ZhangJun9519 小时前
在 32GB 内存电脑上本地搭建 Qwen3.6-35B-A3B 大模型踩坑实录
运维·人工智能·阿里云·ai·软件构建
一条破秋裤19 小时前
Linux 共享内存通信:POSIX 共享内存与 mmap
linux·运维·服务器
CoderJia程序员甲20 小时前
GitHub 热榜项目 - 周榜(2026-09-26)
ai·大模型·llm·github
贵州山魈羡民20 小时前
【玩转手机】通过 Podroid 上的 Alpine 部署 1Panel,把微型服务器装进口袋
运维·服务器
小白的码BUG之路20 小时前
Docker -- 构建nacos镜像
运维·docker·容器
谷哥的小弟21 小时前
CentOS Stream浴火重生
linux·运维·centos
程序员-Benothing1 天前
Shell输入输出详解:read、echo、printf、颜色输出
linux·运维·服务器
和裕1 天前
全纸结构重型纸箱能否满足 1 吨以上设备出口熏蒸豁免要求?通关合规性全解析
大数据·运维·网络·人工智能·算法