我研究了一周怎么都没办法用Git Bash上传到远程库?

浏览:47日期:2023-10-19

问题描述

ssh:connect to host github.com port 22:Bad file numberfatel;cound not read from remote repository.please make sure you have the correct access rightsand the repository exists ??我研究了一周怎么都没办法用Git Bash上传到远程库?

问题解答

回答1:

以github为例,我搜到了这篇:https://help.github.com/articles/error-bad-file-number/首先使用以下命令测试:ssh -vT git@github.com发现更多错误信息。

然后结合你现在看到的错误提示:

ssh:connect to host github.com port 22:Bad file numberfatel;cound not read from remote repository.please make sure you have the correct access rightsand the repository exists

大概是权限问题吧,1. 尝试把公钥上传到github2. 远程的repo的权限不够?

回答2:

GIT设置问题:第一步:设置

git config --global user.name '你在githbub上注册的名'git config --global user.email '你在githbub上注册的电邮'

第二步: 授权,假设你用SSH来连接我研究了一周怎么都没办法用Git Bash上传到远程库?

第三步 创建库,这个在GITHUB上操作,不用累述

当你在本地

git commit

然后,就

git push

你看到提示’ git remote add <name> <url>’然后,你再

git push

说多了,如果你看英文帮助,都在里面git 配置

回答3:

你应该在.ssh目录添加一个config文件设置端口443

相关文章: