git – Check and Change Remote Location

May 29, 2017 - git

Did it ever happen to you that you have started a local git repository for functionality test or proof of concept and after a few days you had no idea whether a repository on GitHub was already up and running or you still didn’t ‘backup your code’?

Well, sometimes it happens even to the best of us!

Check remote repository

A simple command will suffice:

git remote -v

If it returns the location, great – you already have remote repository set up and now you can git push to update it.
If you didn’t get the location back, do this:

git remote add origin
git push -u origin master
Tags: ,