2

Whenever I try to push changes to a remote github repository from the command-line, I receive the following error:

> git push
remote: Repository not found.
fatal: repository 'https://github.com/MyOrg/MyRepo.git' not found

(I've replaced org and repo name, but they are definitely the correct names).

I have checked I have write access to the repository. I'm able to create branches and write to files through the github website, and pull these changes back down locally.

I am authenticating with github using the Git Credential Manager for Windows (GCM), and I have the following in gitconfig:

[credential]
    helper = manager

I'm running on Windows 10, git version 2.10.2.windows.1.

Lozzer
  • 155
  • 2
  • 12
  • Have you looked at this? http://stackoverflow.com/questions/10116373/git-push-error-repository-not-found They suggests adding the username to the url like: https://myusername@github.com/path_to/myRepo.git – Sebastian Berge Mar 29 '17 at 11:26
  • Have you initialized your local git repo correctly using `git init` and added the remote `git remote add origin https://github.com/user/repo.git` ? Sorry if this is obvious – SvinSimpe Mar 29 '17 at 11:27
  • @SvinSimpe The repo was cloned from github, if I run `git remote show origin` it all looks to be set-up correctly. – Lozzer Mar 29 '17 at 12:17
  • @SebastianBerge tried `git remote set-url origin https://username@github.com/path_to_myRepo.git` but still set the repository not found error. – Lozzer Mar 29 '17 at 12:22

3 Answers3

5

In my case the problem was with Git Credential Manager, I deleted the saved credential from Windows through Control Panel > User Accounts > Credential Manager > Windows Credentials. The next time I tried to push it popped up a dialog prompting for the github username and password. On entering these it seems to have sorted itself out.

Lozzer
  • 155
  • 2
  • 12
0

You need to specify what branch you want to push to.

-git push origin branchName

GitHub Docs: Pushing to a remote

SvinSimpe
  • 850
  • 1
  • 12
  • 28
0

have you tried using the command suggest by SvinSimpe when you first cd into the directory where the branch is locally stored?

Erdne Htábrob
  • 819
  • 11
  • 29
  • Yes, I was running the command from inside the directory. I have sorted it now, will post a response just in case others come across it too. – Lozzer Mar 29 '17 at 12:36