-4

I created a project in my terminal, Ubuntu. I then did

git init
git add .
git commit -m "fc"

Then, I created a PRIVATE repo on github.

Finally,

~$ git remote add github.com/my-user-name/XXXXXXX.git
~$ git push -u origin master

But I get this error

fatal: 'github.com/my-user-name/XXXXXXX.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have SSH set up with this computer.

Thanks for the help.

  • Try this https://stackoverflow.com/questions/18842120/git-pushing-to-a-private-repo – hedy Aug 19 '20 at 03:02
  • 3
    Does this answer your question? [Git pushing to a private repo](https://stackoverflow.com/questions/18842120/git-pushing-to-a-private-repo) – hedy Aug 19 '20 at 03:03
  • See Github's docs: [Which remote URL should I use?](https://docs.github.com/en/github/using-git/which-remote-url-should-i-use) – Gino Mempin Aug 19 '20 at 04:15

1 Answers1

1

You need to specify the protocol, like https:// or git://. Without the protocol, the URL refers to a file on your computer, which probably doesn't exist.

So for example,

git remote add origin https://github.com/my-user-name/XXXXXXX.git
wjandrea
  • 28,235
  • 9
  • 60
  • 81