If you start a new project and want to use git, the easiest way is to create and empty repository to the remote server and clone it to your local computer.
Navigate to the target folder and execute command:
git clone https://github.com/my_user/my_repo
If you have the project with code, but you haven't created the repo yet, you can follow these instructions to create a local repo and push it to remote repo.
Create the repository to the remote server. In this example the repository will be:
If you clone a remote repository and then check it with the command
git remote -v, you will see something like origin https...... The word origin is just a nickname for the remote repository.
You can add that kind of nicknames example like this:
git remote add myRemoteRepo https://github....
And then you can push with the command
git push myRemoteRepo localbranch
And you can remove those nicknames like this
git remote remove myRemoteRepo