【发布时间】:2021-08-26 19:53:21
【问题描述】:
在编写了一个 javascript 项目后,我写了
git push -u origin main
但是它给了我回报:
ssh: connect to host github.com port 22: Undefined error: 0
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我该怎么办?我一般是 git/github 的新手,一直在尝试解决它,但运气不好。提前谢谢大家的回答
【问题讨论】:
-
这些是 SSH 的说明。您是否已将 SSH 密钥上传到 GitHub? docs.github.com/en/github/authenticating-to-github/…
-
是的,谢谢你成功了!
-
你是否从 git 仓库添加了 remote-url ?在
git push之前,添加带有git remote add origin https://github.com/user-name/repo-name.git的url。 -
旁注:那个错误信息,
Undefined error: 0很糟糕。显然 Mac 版本的 ssh 需要一些工作。 (您运行的是哪个 macOS?)
标签: git github git-remote repo