如何在服务器上克隆、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后点击这个图标即可复制:
相关推荐
幸福指北16 分钟前
我用 Tauri + Vue 3 + Rust 开发了这款跨平台网络连接查看工具PortView,性能炸裂!
运维·网络·监控
前端DOM哥1 小时前
GitHub 热榜 Top 10 🔥(3·15)
github
青柠代码录2 小时前
【Linux】路径区分:testdir、testdir/、testdir/*
linux·运维·服务器
Benszen3 小时前
Docker容器化解决方案全解析
运维·docker·容器
badhope4 小时前
Docker从零开始安装配置全攻略
运维·人工智能·vscode·python·docker·容器·github
mounter6254 小时前
基于MLX设备的Devlink 工具全指南与核心架构演进
linux·运维·服务器·网络·架构·kernel
xuanwojiuxin4 小时前
[linux] what‘s the kdump?
linux·运维·服务器
用户23063627125394 小时前
SpringAIAlibaba学习使用 ---Graph
后端·github
jerryxiaosa5 小时前
从后台管理到 IoT 远程控表,这个 Spring Boot 3 开源项目把能耗管理链路做完整了
github
透明的玻璃杯5 小时前
关于QT客户端和服务器端之前状态监控
运维·服务器