错误:未通过SSH找到Linux终端Github的存储库

时间:2018-02-15 16:32:01

标签: git

我已经尝试过我所相信的一切。从SSH更改为HTTPS,确保提交,我已经搜索了几个小时,但在尝试所有内容后仍无济于事。我的终端输出如下。我确信这是一个简单的修复,因为我的朋友已成功在GitHub中创建了一个回购并在我的设备上推送到了它,但我不记得她做了什么不同的事情,唉,我不再与她联系。

$ git init
Reinitialized existing Git repository in 
/home/alexander/Dropbox/projects/GroupProject/.git/
$ git add .
$ git commit -m "second test"
On branch master
nothing to commit, working directory clean
$ git push -u origin master:master
ERROR: Repository not found.
fatal: Could not read from remote repository.

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

1 个答案:

答案 0 :(得分:1)

您输入

git push -u origin master

(删除:master)

这意味着您要向服务器源发送内容。您尚未从显示的日志中设置此类服务器。

要查看您设置的服务器,请输入git remote -v

你还没有看到任何东西,因为你还没有设置。

您想添加朋友设置的GitHub仓库。

要做到这一点,请输入朋友回购的链接。像

这样的东西
git remote add origin <remote repository url of your friends repo>

有关详细信息,请参阅https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

添加原点后,您可能需要执行git pull origin master来获取代码。

但是,为您设置所有内容只需git clone <repo from your friend>。这样就可以为您设置远程原点。

祝你好运!