简体   繁体   English

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

[英]ERROR: Repository not found Linux Terminal Github over SSH

I have tried just about everything I believe.我已经尝试了几乎所有我相信的东西。 change from SSH to HTTPS, making sure to commit, I have been search for hours and still to no avail after trying everything.从 SSH 更改为 HTTPS,确保提交,我已经搜索了几个小时,但在尝试了所有方法后仍然无济于事。 My terminal output is below.我的终端输出如下。 I am sure it is a simple fix because my friend has successfully created a repo in GitHub and pushed to it on my device, but I do not remember what she did differently, and alas, I am no longer in contact with her.我确信这是一个简单的修复,因为我的朋友已成功在 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.

You type你输入

git push -u origin master

(remove the :master) (删除:master)

That means that you want to send something to the server origin.这意味着您要向服务器源发送一些内容。 You have not setup such a server from the log you show.您还没有从您显示的日志中设置这样的服务器。

To see which server you setup go ahead and type git remote -v要查看您设置的服务器并输入git remote -v

You should see nothing since you have not yet setup something.您应该什么也看不到,因为您还没有设置一些东西。

You want to add the GitHub repo that your friend setup as your origin.您想添加您朋友设置的 GitHub 存储库作为您的源。

To do that type the link of your friends repo.要做到这一点,请输入您朋友的回购链接。 Something like就像是

git remote add origin <remote repository url of your friends repo>

See https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ for more info.有关更多信息,请参阅https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

Once you have added origin you probably want to do git pull origin master to get the code.添加 origin 后,您可能想要执行 git pull origin master 来获取代码。

However, to have everything setup for you just do git clone <repo from your friend> .但是,要为您设置好一切,只需执行git clone <repo from your friend> That way the remote origin is setup for you.这样就可以为您设置远程源。

Good luck!祝你好运!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM