Adding a remote to your project
Create a new gitlab project
on your personal gitlab site
and follow the gitlab instructions.
Note: make sure that the remote starts with git@
and not https
if you want to use a ssh key.
You can see the https and ssh url when clicking on the clone
button.
- In order to verify that your remote was successfully added to your local project you can type:
git remote -v
on your terminal (when you are somewhere inside you git project folder).
- The
-u
option when doing the initial push in the gitlab instructions sets the upstream. This means that you do not always need to typegit push <remote_name> <branch>
but that it is enough to typegit push
orpull
respectively.
In other words you set a default remote and branch.