windows - Git Push 失败并在 Windows 中返回 403
问题描述
环境
- 客户端:Windows
- 服务器:高格斯
我想将一些源推送到 git 存储库。
但是推动它存在一些问题。
错误信息如下:
D:\workspace\excel-demo>git push -u origin master Counting objects:
42, done. Delta compression using up to 8 threads. Compressing
objects: 100% (28/28), done. Writing objects: 100% (42/42), 50.75 KiB
| 2.82 MiB/s, done. Total 42 (delta 2), reused 0 (delta 0) error: RPC
failed; HTTP 403 curl 22 The requested URL returned error: 403
Forbidden fatal: The remote end hung up unexpectedly fatal: The remote
end hung up unexpectedly Everything up-to-date
我在远程信息中设置了凭据,例如test@~~~~/~~~.git
我应该怎么办?
解决方案
test@~~~~/~~~.git
不是“凭据”(登录名/密码),而是一个 SSH URL,这意味着:以用户“test”连接到远程服务器,并~~~.git
用作远程 Git 存储库目标。
假设您的 %USERPROFILE%.ssh 中有一个 SSH 密钥对。
并且公钥 (id_rsa.pub) 已在~test/.ssh/authorized_keys
.
如果不是这种情况,您需要检查远程服务器希望您如何进行身份验证(用户名/密码?SSH 密钥?)
推荐阅读
- java - 带有返回值的@Contract 注释以及更改和未更改的参数
- javascript - 表单验证功能在提交时不运行
- java - 在 Spring Boot 中使用微服务 Jar 文件部署时访问网络目录上的外部文件
- javascript - 从行中提取值以在 URL 中使用
- python - 在范围内生成多个唯一随机整数的最快速和计算效率最高的方法,不包括整数列表
- php - 为什么我无法在 mvc 中使用 phpseclib 登录?
- google-api - 如何在没有 api 库的情况下从 Google 获取访问令牌?
- php - 在项目外使用 CakePHP 3 和 PHPUnit 8 进行单元测试
- javascript - 当我在这个字符串的末尾添加多个字符时,为什么我什么也得不到?
- scala - Akka-Http WebSocket:处理传入消息非常慢