If you want to collaborate in a project or share your project with others globally, you need to add a remote repository.
For now, imagine there is a github repository hosted at https://github.com/learntogit/testrepo.git
To push local repository to remote repository, use the following code:
git remote add origin "https://github.com/learntogit/testrepo.git"