.. description: Let's have a deeper look at remotes
.. type: text
In the previous post, we talked about branching and merging. We will say a few last words on branches in this post and dive into remotes.
What are remotes ? What are they for ? How are they used ?
Coming right up.
.. TEASER_END
Requirements
============
In this post, we will need another requirement.
* First, you obviously need ``git``.
* Second, you will need a git repository on a git server. Easier way is to create an account on `Gitlab <https://gitlab.com>`_, `GitHub <https://github.com>`_ or other similar services.
Branches
========
I have a few more things I need to say about branches...
If you came to the same conclusion that branches in ``git`` are *cheap*, you are correct.
This is very important because this encourages you to create more branches.
A lot of short living branches is a great way to work.
Small features added here and there. Small projects to test new features, etc...
Second conclusion you can come up with from the previous post is that the ``master`` branch is not a *special* branch.
People use it as a *special* branch, or the branch of **truth** by convention *only*.
I should also note that some services like **Gitlab** offer master branch protection on their own which would not allow master history overwriting.
The best next topic that comes after *branches* is a topic extremely similar to it, **remotes**.
Remotes
=======
The description of ``git-remote`` from the `manual page <https://git-scm.com/docs/git-remote>`_ is simply
Manage the set of repositories ("remotes") whose branches you track.
That's exactly what it is. A way to manage *remote* repositories. Now we will be talking about managing
them in a bit but let's talk about how to use them.
I found the best way to think to work with them is that you can think of them as *branches*.
That's exactly why I thought this would be best fit after that blog post.
Listing
-------
Let's list them on our project and see what's what.
..code:: text
$ git remote -v
Okay! Nothing...
Alright, let's change that.
We don't have a *remote* repository we can manage. We need to create one.
Adding a remote
---------------
So I went to **Gitlab** and I created a new repository.
After creating the repository, you will get a box with commands that look similar to the following.