If you start a new project and want to use git, the easiest way is to create and empty repository to the remote server (ex. GitHub, GitLab, ...) and clone it to your local computer.
Navigate to the target folder and execute command:
git clone https://github.com/my_user/my_repo
When you clone the repository, Git will add a shortname to the remote repository and it will use origin as the name. You can check the remote repository with then command
git remote -v
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:
So, when you clone a remote repository, Git will create the shortname origin.
You can add that kind of shotnames example like this:
git remote add myRemoteRepo https://github....And then you can push with the command
git push myRemoteRepo localbranchAnd pull with the command
git pull myRemoteRepo localbranch
And you can remove those shotnames like this
git remote remove myRemoteRepo