通过命令行推送找不到现有的远程github存储库

东边发展
OS: Mac Mojave

我有一个个人GitHub帐户,我也有贡献,还有一些其他公司帐户。

在我的私人帐户上,我创建了一个私人仓库,我想做的是将本地磁盘上的一些源代码检查到该存储库中。

在Mac终端上,我确保我位于要检入空私人存储库的目录中,然后执行以下操作:

git init
git add .
git commit -m "checking existing files into my private repo"

然后,我去了我的私人仓库,复制了URL,说:

https://github.com/myaccount/myPrivateRepo

然后,我执行以下操作:

git remote add origin https://github.com/myaccount/myPrivateRepo

然后执行:

git remote -v

并得到以下回应:

origin  https://github.com/myaccount/myPrivateRepo (fetch)
origin  https://github.com/myaccount/myPrivateRepo (push)

我假设的意思是:一切都检查正常

然后我尝试使用:

git push -u origin master

这给了我以下错误信息:

remote: Repository not found.
fatal: repository 'https://github.com/myaccount/myPrivateRepo/' not found

有任何想法吗?

我确实将遥控器更改为:

git remote add origin [email protected]:myaccount/myPrivateRepo.git

当我尝试推送时,出现以下错误:

The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).

致命:无法从远程存储库读取。

Please make sure you have the correct access rights and the repository exists.
Nikos C.

您添加的遥控器应采用以下形式:

[email protected]:myaccount/myPrivateRepo.git

还要设置您的git电子邮件地址以匹配您的github帐户的电子邮件地址:

git config user.email "[email protected]"
git config user.name "Full Name"

您也可以通过编辑.git/config文件来编辑它们

最后,确保正确设置了SSH公钥:

https://github.com/settings/keys

您的公共密钥应位于中cat ~/.ssh/id_rsa.pub您可以使用以下命令进行打印:

cat ~/.ssh/id_rsa.pub

如果您还没有SSH公钥,请遵循以下指南:

https://help.github.com/en/articles/connecting-to-github-with-ssh

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

从命令行打开现有的Tower git存储库

是否可以通过命令行删除Github上的远程存储库?

当我第一次从命令行推送现有存储库时

无法通过命令行将我的Web应用程序推送到GitHub存储库中

从命令行推送到现有的AWS Elastic Beanstalk应用程序

ld找不到现有的库

通过命令行在现有的融合实例中打开新选项卡

是否可以通过其他本地存储库更新现有的Github存储库?

将现有的提示命令行分成几行

如何将新代码推送到 github 中现有的 git 存储库

如何将现有的 Visual Studio 项目推送到不同的 GitHub 存储库

将当前代码推送到现有的GitHub存储库

有没有办法通过命令行或git将GitHub中的所有存储库/存储库设为私有?

Maven找不到现有的远程工件

Github复制存储库:修复远程:找不到存储库

找不到命令行

从命令行打开远程git存储库

无法从命令行SSH到远程存储库

如何通过命令行添加/更改github的存储库描述

如何通过命令行从公共 github 存储库下载二进制文件?

如何通过命令行查看您在Github中创建的存储库?

无法推送现有的本地git存储库

将现有的Git存储库推送到SVN

使用命令行+ API创建Github存储库

如何使用命令行从私有github存储库中下载单个原始文件?

远程:找不到存储库

将远程heroku存储库添加到我现有的本地存储库后,无法推送到heroku

ocaml命令行找不到“ topfind”

找不到elasticsearch命令行工具