use*_*482 4 git github git-push git-config
我正在创建新分支并尝试推送分支(我尝试了以下命令):
git push --all -u
git push origin NewBranch
Run Code Online (Sandbox Code Playgroud)
但在这两种情况下,我都会收到此错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
这是我的 .git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = ssh://git@github.com/myName/myRepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = ssh://git@github.com/myName/myRepo.git
Run Code Online (Sandbox Code Playgroud)
这是起源:
origin ssh://git@github.com/myName/myRepo.git (fetch)
origin ssh://git@github.com/myName/myRepo.git (push)
Run Code Online (Sandbox Code Playgroud)
你们中的任何人都知道这个错误的原因吗?
我会非常感谢你的帮助
再检查一遍:
myName/myRepo.git如果问题仍然存在 https url
git remote set-url origin https://github.com/myName/myRepo.git
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
21214 次 |
| 最近记录: |