Using branches
A big advantage of Git is that we can not only use it really well for smaller projects, on which just a few people work, but also for much bigger software projects on which several hundred developers work. And so, Git provides a lot of different tools to manage all kinds of different situations.
One of the most important functions is called Branches. They give us the ability to try out something experimental or split our commits. The default branch is master. So, you actually have already been using branches, as this branch was where you committed all your changes to.
We can create our own branches with the checkout
function:
git checkout –b <branch name>
After we create our new branch, we can see it in the Git pane in RStudio. So, we can actually choose in what branch we want to commit our staged changes.
To actually to use the push
and pull
functions with this branch, we need to tell RStudio that there is a remote equivalent connected to this local branch. We can do this...