Git push fatal: repository not found
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.
MrRoboto
Updated on July 09, 2022Comments
-
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 over 7 yearsYou have a solution?
-
adrianvlupu over 7 yearsYes, 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 over 6 yearsCheck what... ?
-
Raj Yadav over 6 yearsCheck 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. over 6 yearsMore specifically, these instructions from GitHub help, regardless which remote platform you're using help.github.com/articles/changing-a-remote-s-url/…
-
lpkej over 4 yearsIn 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 over 3 yearssaved me a nightmare. Thanks a ton...wasn't able to figure out what was happening even when I set-up a fresh repo