Git push fatal: repository not found

25,921

Solution 1

As mentioned above this happens when the repository, team name or username changes. The solution is to set the new remote url, as shown below.

git remote set-url origin https://______________.git

Solution 2

This kind of thing happens when the repo, team name or username changes.

Happened to me when I changed the team name and all of the repos lost their origin.

Solution 3

I think, my answer can save someone a few minutes and some nerves.

I ran into the same issue. Solved the problem by running the following Git command:

git push --set-upstream origin master

The reason: When you initialize git repository to local working directory, Git only initializes "origin", and has no upstream set to commit your changes.

Share:
25,921
MrRoboto
Author by

MrRoboto

Updated on July 09, 2022

Comments

  • MrRoboto
    MrRoboto almost 2 years

    I'm not sure what is going on. But every time I try to push or pull now with git I get this message "fatal: repository 'https://....' not found". I usually use source tree with bitbucket but am receiving the same error when I try from the command line.

    The reason I'm so confused is I haven't done anything that should change the repository. This repository has had hundreds of commits from me and other team members and nothing has changed since we created it. We rarely use any advance features not even branching, just pull, push, commit, and merge. Any what could have happened and how to fix it?

    I've already tried removing and re-adding the origin but no luck.

  • Olle Härstedt
    Olle Härstedt over 7 years
    You have a solution?
  • adrianvlupu
    adrianvlupu over 7 years
    Yes, go to bitbucket, copy the url to the repo again (the one ending with .git) and update the remote. I know he said he did it already, but I find myself pasting the wrong url more often than I like to admit.
  • Maciej Jureczko
    Maciej Jureczko over 6 years
    Check what... ?
  • Raj Yadav
    Raj Yadav over 6 years
    Check whether https or ssh url ends with .git. If not its mercurial. In such case, delete the repository and create new one. AND DONOT FORGET TO CHECK "GIT REPOSITORY"
  • Justin L.
    Justin L. over 6 years
    More specifically, these instructions from GitHub help, regardless which remote platform you're using help.github.com/articles/changing-a-remote-s-url/…
  • lpkej
    lpkej over 4 years
    In some cases when there's multiple environment branches and to run your Git command just basically means "don't test, just push your changes to master". I'm sure it works when you use 2 > branches.
  • nitigyan
    nitigyan over 3 years
    saved me a nightmare. Thanks a ton...wasn't able to figure out what was happening even when I set-up a fresh repo