Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

git - GitHub: ERROR: Repository not found. fatal: The remote end hung up unexpectedly (different from similar posts apparently)

I created a directory, hello_git. In this directory I created a file, hello_git.py, which prints out a "Hello git!" message.

Then I made hello_git my current directory in the terminal and entered the following commands one after another in that directory:

git init
git add hello_git.py
git commit -m 'first commit'
git remote add origin git@github.com:githubaccountname/hello_git.git

When I enter the command git push origin master I get asked:

Enter passphrase for key '/home/myusername/.ssh/id_rsa':

When I enter my passphrase (which authenticates successfully using ssh -T git@github.com) I get this:

ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

I don't know if this helps, but:

git remote -v

returns:

origin    git@github.com:githubaccountname/hello_git.git (fetch)
origin    git@github.com:githubaccountname/hello_git.git (push)

I have looked into answers of similar posts, but nothing seems to work:

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Eric has already given the best answer for this question in the case that the repository does not exist, but I want to point out that:

The response pair of "Repository not found. / remote end hung up unexpectedly" is also given by GitHub when the repository does exist, but the user does not have permission to push to it.

If you're absolutely certain that the repository already exists on GitHub, make sure the account you're using has permission to push to that repository.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...