简体   繁体   English

SSH git 推送时出现“没有这样的文件或目录”错误

[英]SSH "no such file or directory" error on git push

I have a private key that lives at ~/.ssh/github_rsa , and the corresponding public key has been uploaded to my Github account.我有一个位于~/.ssh/github_rsa的私钥,相应的公钥已上传到我的 Github 帐户。 I created a repository and set it up as the remote for the directory I'm working from, and in that directory's .git folder, I have the following config file:我创建了一个存储库并将其设置为我正在使用的目录的远程,在该目录的.git文件夹中,我有以下config文件:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    sshCommand = 'ssh -i ~/.ssh/github_rsa -o IdentitiesOnly=yes'
[remote "repoName"]
    url= git@github.com:myusername/repoName.git
    fetch = +refs/heads/*:refs/remotes/repoName/*

When I run git push -u repoName main , I get the following error:当我运行git push -u repoName main时,出现以下错误:

'ssh -i ~/.ssh/github_rsa -o IdentitiesOnly=yes': line 1: ssh -i github_rsa -o IdentitiesOnly=yes: No such file or directory
fatal: Could not read from remote repository.

Removing -o IdentitiesOnly=yes has no effect.删除-o IdentitiesOnly=yes没有任何效果。 Changing permissions on the key from 600 to 400 also had no effect.将密钥的权限从 600 更改为 400 也没有效果。 The file definitely exists, and exists at exactly that path.该文件肯定存在,并且存在于该路径中。

gitconfig doesn't recognize single quotes. gitconfig 不识别单引号。 Use double quotes.使用双引号。

[core]
    sshCommand = "ssh -i ~/.ssh/github_rsa -o IdentitiesOnly=yes"

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

相关问题 ssh -vT git@github.com收到“没有这样的文件或目录”错误 - ssh -vT git@github.com get “ No such file or directory” error git 推送错误:无法写入文件./objects/... 没有那个文件或目录 - git push error: unable to write file ./objects/… No such file or directory git push-似乎不是git存储库(ssh指向错误的目录) - Git push - does not appear to be a git repository (ssh pointing to wrong directory) Visual Studio 2019 git 问题:“无法生成... ssh.exe:在获取/推送时没有此类文件或目录” - Visual Studio 2019 git problem: "Cannot spawn ... ssh.exe: No such file or directory" on fetch/push 拉或推到 git 时出错:ENOENT:没有这样的文件或目录 - Error when pull or push to git: ENOENT: no such file or directory 用ssh配置文件推送到git服务器 - push to git server with ssh config file Git Ahead SSH 错误 - 无法克隆到“我的目录” - 找不到 SSH 身份文件 - Git Ahead SSH Error - Failed to clone into 'my directory' - failed to find SSH identity file git ssh推送到服务器,公钥错误 - git push with ssh to server , public key error 无法将 git 推送到远程存储库:(SSH 错误) - Cannot push git to remote repository: (SSH error) 由于SSH错误,Git无法推入puttycyg - Git is failing to push in puttycyg because of SSH error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM