DEV Community

Cover image for Git remote? What is that?
Antonio Marcos Oliveira
Antonio Marcos Oliveira

Posted on

Git remote? What is that?

Hi guys! This is my first one article (and I hope that this could be the first one of a series) about my dev trajectory.
Well, today I want to share with you something that I passed through and even after some time using git, I've never stopped to think about it: git remote.
Due to this quarantine time, I've got more free time and decided to put into practice an old desire: learning React. So, I followed the tutorial (which is very helpful for who wants to start) and didn't follow the good practices by doing all the tutorials without making anyone commit.
So here begins the start of my saga: I create the repository on GitHub and follow all steps to push my code, but in a moment of distraction did a mistyping and add a ~ in the end of the link and try to push... and get an error. Tried again, and got the same error. Omg, what I could've done to get this error? Search on the web and nothing seems to be the solution to my error. Fortunately, I talked to a friend and she told me: well, you can show me the git remote of this repo? Even without understanding very well, search the command to do this
$ git remote -v and finally could see: a simple hookie mistake, but get me so frustrated, almost giving up on pushing the code. So, after seeing the mistake, hit another command to fix the connection to the real repo: $ git remote set-url origin git@hostname:USERNAME/REPOSITORY.git and could push my code to GitHub.
Well, I hope that my mistake could help some new devs who are starting to learn about code versioning. So, maybe I come back here to share new stories. See ya!

Top comments (2)

Collapse
 
bravearthemis profile image
Amalem resmungona

I will remember this article when I will see a similar problem tks dude

Collapse
 
toiinnn profile image
Antonio Marcos Oliveira

I'm so glad that you liked!!