1
votes

When I try to push my application to GitHub using Git, I get the following:

$ git push origin master
Enter passphrase for key '/c/Users/Medicine - SWEng/.ssh/id_rsa':
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

Output of running git remote -v:

$ git remote -v
heroku  [email protected]:young-rain-273.git (fetch)
heroku  [email protected]:young-rain-273.git (push)
origin  [email protected]:SWEngineer7sample_app.git (fetch)
origin  [email protected]:SWEngineer7sample_app.git (push)
sample  [email protected]:SWEngineer/sample_app.git (fetch)
sample  [email protected]:SWEngineer/sample_app.git (push)

How can I solve this issue?

3
Can you do a git remote -v and paste the output here?Noufal Ibrahim
Maybe there is a problem with the configured URL. What does "git remote show origin" show for fetch and push url?dunni
it look like you have not properly set up yours RSA keys; check the githut setup docs;Alexander Beletsky

3 Answers

6
votes

The error message is clear (and correct):

ERROR: Repository not found.

The problem is that origin is set to [email protected]:SWEngineer7sample_app.git which is surely wrong. Obviously, you didn't press SHIFT-7, but only 7 when entering the repo path, therefore there's a 7 where there should be a /. Simply a typo.

origin should be defined same as sample ([email protected]:SWEngineer/sample_app.git), then GitHub will also find a repo.

To resolve this,

git remote rm origin
git remote add origin [email protected]:SWEngineer/sample_app.git
1
votes

You might also get "ERROR: Repository not found" if you are trying to push to a repo for which you do not have push access. It would be nice if the error were more clear, but if (for example) you are pushing to someone else's repo, check with the owner to make sure you have push access.

According to Help.GitHub - Remotes:

First you need a repo on GitHub you can push to. Either create a new repo, gain collaborator permissions on someone else’s repo, or fork someone else’s repo. You can only push to an ssh URL like [email protected]:user/repo.git or an https URL such like https://[email protected]/user/repo.git. If you cloned another repo with a read-only URL you can add a second remote for your URL or remove or rename the existing remote.

-1
votes

You have a public key issue. Use a key with no password, and simply press enter when prompted for one when making it.

Use ssh to the GitHub repository with the -vvvv parameter to see which SSH key is being offered.