I want to add remote repository from my shell but fail. I'm logged in and I'm in my local repository. So I enter this:
% git remote add origin https://github.com/<username>/example.git
% git remote -v
origin https://github.com/<username>/example.git (fetch)
origin https://github.com/<username>/example.git (push)
So it seems that the repo has been created. But I see no new repo in my github account. And when I try to inspect the remote (or push anything there) it throws an error:
% git remote show origin
remote: Repository not found.
fatal: repository 'https://github.com/<username>/example.git/' not found
I tried googling similar questions but couldn't find the answer. Does anyone know what I might be missing?
git remote add does not "create the repo on github", it only links your local repo to an (existing) remote repo on github.
If example.git does not exist on github, you need to first create it (e.g : create an empty example repo through github's website).
After that, your regular git commands will work (push, pull, remote show ...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With