Reputation: 917
I cloned my repo on my laptop and followed the steps:
git add .
git commit -m "First commit"
git remote add origin (repository URL)
git push -u origin master
but for some reason, I get a fatal error telling me that the repo not found. What's the issue?
Upvotes: 0
Views: 188
Reputation: 1328732
You can refer to the official GitHub "Error: Repository not found" listing the main reasons:
In your case, the origin url is wrong:
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
In your case:
git remote set-url origin https://github.com/Flock1/Udacity.git
That won't change anything about the repo: you can add an push.
That is: you clone a full repo, not a folder within the repo.
error: failed to push some refs to 'https://github.com/Flock1/Udacity.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart
If your working tree is clean (meaning if git status
reports there is no modification or untracked file), do:
git pull --rebase
git push
That will replay your commits on top of the updated upstream remote repo.
Upvotes: 1
Reputation: 2872
After adding the remote origin, run git remote -v
to see if your remote git address(es) is/are listed.
From there you should ensure that your remote origin
url looks right. A remote url should look like https://github.com/USERNAME/REPOSITORY.git
.
If you need to remove an incorrect origin
and assign a new one you can remove that remote with the following command git remote rm origin
Upvotes: 0