Reputation: 1949
Making a new branch on github throwing this error
remote: Repository not found. fatal: repository 'https://github.com/mckenzieflavius/myrepository.git/' not found
Ive checked spelling a thousand times so ill give exact information on what im doing.
What I've Done
on github im on an account with a different email address. e.g. [email protected] and made a new repository.
locally my config email address is [email protected] but ive set it manually for this 1 repository to [email protected] along with my username to that of my git account.
Locally ive ran git init
followed by git commit -m "initial commit"
and git remote add origin https://github.com/myrepository.git
to set it
then git push origin master
But i get the above error. Im really not sure what im doing wrong.
Ive even followed the guide on git to push an existing project to git and i get the same thing.
EDIT:
I know it was only helpful but ive already put that ive created a repo on github earlier on in this question, an image here
Upvotes: 1
Views: 64
Reputation: 1949
Right so i found this pretty strange and im not sure which of the following it had to do with but ill list all the changes I've done anyway
As i said before i was using a different account from the one that hosted the private repository, i added the second account as a collaborator. Im not sure this is what fixed it however.
Secondly the local repository wasn't empty, it had files on, previously i committed the files via git commit -m "Initial file commit"
but i didn't add them, (I was following the instructions on the git page, but i didn't want a readme on the page). So when i then went to commit it was throwing that error.
Solution
I think the problem was that there was nothing committed, but the information that the GitHub error thrown was inaccurate and misleading. By nothing committed i mean there was no file changes in the commit it was just an empty folder, i think there needs to be at least 1 file or folder in the local repo before you can push it.
Also when i googled that error, a load of unrelated ones came up and i was following them in hopes mine would also work, but they didn't.
Upvotes: 0
Reputation: 91
This is probably caused because your repo is set to private and you don't have rights to push to this repository.
Upvotes: 0
Reputation: 2289
Looking at your Github user-account https://github.com/mckenzieflavius?tab=repositories, you have not created a repository yet. You will only be able to push to remote repos that actually exist, so what you have to do is create myrepository
first via the Github website, then you can push to it.
Upvotes: 1