简体   繁体   English

git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取

[英]git@github.com: Permission denied (publickey). fatal: Could not read from remote repository

I'm new to git and anytime i try to push to my repository using "git push origin master", i get this error我是 git 新手,每当我尝试使用“git push origin master”推送到我的存储库时,我都会收到此错误

git@github.com: Permission denied (publickey). git@github.com:权限被拒绝(公钥)。 fatal: Could not read from remote repository.致命:无法从远程存储库读取。

i believe i must have incorrectly entered my git credentials (username or password) and the system have saved the incorrect credentials.我相信我一定是错误地输入了我的 git 凭据(用户名或密码),并且系统保存了错误的凭据。 Please how do I delete the already stored credentials so that i can be prompted to enter again my credentials when i want to push to my repository.请如何删除已存储的凭据,以便在我想推送到我的存储库时提示我再次输入我的凭据。 i use Linus OS.我使用 Linus 操作系统。

Thank you.谢谢你。

When using git over ssh, you need a public/private key pair.在 ssh 上使用 git 时,您需要一个公钥/私钥对。

  • If you already have setup a public/private key pair, it would probably be located in ~/.ssh/id_rsa.pub .如果您已经设置了公钥/私钥对,它可能位于~/.ssh/id_rsa.pub
  • If you don't have that setup with GitHub, you should set that up如果您没有使用 GitHub 进行设置,则应该进行设置

Alternativly, you can just push to the GitHub repository with HTTPS and your GitHub login, by doing或者,您可以使用 HTTPS 和您的 GitHub 登录名推送到 GitHub 存储库,方法是

git remote set-url --push https://github.com/<username>/<repository>.git

and pushing the repository.并推送存储库。

(first create a repository in git, if not created already) (首先在git中创建一个存储库,如果尚未创建)

This worked for me:这对我有用:

Step 1- git remote rm origin步骤 1- git remote rm origin

Step 2- select the http option in github步骤 2-在 github 中选择 http 选项

step 3- run the following command again第 3 步 - 再次运行以下命令

git remote add origin https://github.com/yourdirectory/link.git git 远程添加源https://github.com/yourdirectory/link.git

git branch -M main git 分支 -M 主

git push -u origin main git push -u origin main

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository git@github.com:来自公共存储库的权限被拒绝(公钥) - git@github.com: Permission denied (publickey) from public repository GitHub:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - GitHub: Permission denied (publickey). fatal: Could not read from remote repository Git:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - Git: Permission denied (publickey). fatal: Could not read from remote repository GIT 权限被拒绝(公钥) - 致命无法从远程存储库读取 - GIT permission denied (publickey) - Fatal could not read from remote repository git@gitlab.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository git@github.com:权限被拒绝(公钥) - git@github.com: Permission denied (publickey) Git:权限被拒绝(公钥)致命 - 无法从远程存储库读取。 克隆 Git 存储库时 - Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM