0

I'm green as grass when it comes to git. Just started learning how to use it yesterday. Whenever I try to push a repository, I keep getting this

error: fatal: repository 'https://github.com/straywind/Demo.git/' not found

This is what I did:

mkdir Demo
cd Demo
echo "#Demo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/straywind/Demo.git
git push -u origin master

I then put in my username and password, and then i get the error message. Any help is much appreciated

torek
  • 448,244
  • 59
  • 642
  • 775
  • If it is not private repository, this is normal. https://github.com/straywind/Demo – Asocia Aug 04 '20 at 07:32
  • Does this answer your question? [Git Push ERROR: Repository not found](https://stackoverflow.com/questions/10116373/git-push-error-repository-not-found) – CodeCaster Aug 04 '20 at 07:32
  • Yeah, I'm with @Asocia: 404 error when trying to reach that page. I assume that repo exists and is private. – Daemon Painter Aug 04 '20 at 07:39
  • Please double check repo status, maybe it is "archived" or something. Please also [add](https://stackoverflow.com/posts/63242089/edit) the remote platform where you are pushing to. Why do I recall bitbucket? – Daemon Painter Aug 04 '20 at 07:48
  • @Asocia It's not private. My github account says there are no repositories yet, private or otherwise. – Riverreed Ward Aug 04 '20 at 08:07
  • @RiverreedWard You need to create that repository first then. – Asocia Aug 04 '20 at 08:08
  • @Asocia, Thanks. Kinda a bonehead problem then. I assumed it would create it automatically, since none of the tutorials I looked at suggested I needed to create on on Github. Weird that tutorials will walk you through simple installation, but not mention that. My bad on any account. – Riverreed Ward Aug 04 '20 at 08:14

2 Answers2

0

As per comments, this turned out to be a simple GitHub issue: you just had not yet created the repository over on GitHub.

(GitHub's requirement here may differ from other hosting sites, although this particular pattern is pretty common.)

As a side note, I'd recommend avoiding uppercase letters in repository names. Parts of URLs are not case sensitive: GITHUB.COM, github.com, and GitHub.com all mean the same thing, for instance. But Git names are case sensitive, and a repository named demo would differ from one named Demo on a Linux host, for instance. Mixing case here is just inviting potential problems and you should pick one case and stick to it—probably lowercase since all-uppercase is a convention for implying that you are shouting.

torek
  • 448,244
  • 59
  • 642
  • 775
0

You might be making it a bit hard for yourself by starting with the git init and then adding the remote.

If you issue a git clone command first, the remote will automatically be set up for you and your first push will go much smoother. If you're working with GitHub, create the GitHub repo first, clone, then do the GitHub push.

git clone https://github.com/cameronmcnz/github-made-easy.git
touch a.html
git add .
git commit -m "commit message"
git push origin
Cameron McKenzie
  • 3,684
  • 32
  • 28