如何在服务器上克隆、pull、push GitHub私有项目

诸神缄默不语-个人CSDN博文目录

情况是这样的,我直接用git clone命令后,会提示让我输入GitHub账号密码,我输入后它还是显示克隆失败,并显示:

复制代码
Cloning into 'folder_name'...
Username for 'https://github.com': user_name
Password for 'https://[email protected]': 
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后点击这个图标即可复制:
相关推荐
海码00732 分钟前
【版本控制】Git 和 GitHub 入门教程
git·github
码农101号2 小时前
Linux中shell编程表达式和数组讲解
linux·运维·服务器
powerfulzyh2 小时前
非Root用户启动SSH服务经验小结
运维·ssh
云道轩2 小时前
升级centos 7.9内核到 5.4.x
linux·运维·centos
爱学习的小道长2 小时前
Ubuntu Cursor升级成v1.0
linux·运维·ubuntu
EelBarb3 小时前
seafile:ubuntu搭建社区版seafile12.0
linux·运维·ubuntu
402 Payment Required3 小时前
serv00 ssh登录保活脚本-邮件通知版
运维·chrome·ssh
小柏ぁ3 小时前
calico/node is not ready: BIRD is not ready: BGP not established with xxx
运维·docker·kubernetes
Mintimate3 小时前
云服务器 Linux 手动 DD 安装第三方 Linux 发行版:原理与实战
linux·运维·服务器
RussellFans3 小时前
Linux 环境配置
linux·运维·服务器