Search code examples
gitgithubgit-push

Why can't I push to the try_git.git repository?


I everyone, I am new to Git and GitHub, I am trying to follow this tutorial:

https://try.github.io/levels/1/challenges/11

But my problem is that when I type git push -u origin master, I get the following prompts:

Machine:Project user$ git push -u origin master
Username for 'https://github.com': My_GitHub_Username
Password for 'https://My_GitHub_Username@github.com': *******
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/try-git/try_git.git/'

I can't push the changes to the remote repository, I tried to change the .git/config file:

[remote "origin"]
    url = https://github.com/try-git/try_git.git

the url param to:

[remote "origin"]
    url = git@github.com:try-git/try_git.git

According to some posts on SO, but this solution hasn't work for me...

Anyway, why do I get those errors? I checked the password for my GitHub account and it's correct, why github.com unauthorizes me pushing? Why in the tutorial they do not show it? Should I make some extra configuration before pushing? Where can I look?

Thanks for the attention!


Solution

  • That tutorial is supposed to be run in the browser only. It will virtualize what happens to the repository when you run the respective commands in there.

    It won’t work when doing this from your actual machine though, as you simply don’t have the permissions to access their repository. Instead, you should create a new repository from your own account and use that then.