add into to branches

This commit is contained in:
Ric Harvey 2024-05-03 17:06:33 +01:00
parent fbf8bd293a
commit 772f9b90e2
Signed by: ric
GPG key ID: CD63CE502B962F16

View file

@ -1,5 +1,24 @@
# Working with Branches
Branches are a way of working on a copy of the code without interfering with the main repository and running into merge conflicts with other developers constantly. Other people can still commit to the main branch or merge in other features but you will be free from all those distractions and free to work on your feature or issue. Lets visualise this below where you make a new branch called **FeatureA**
```mermaid
gitGraph
commit
commit
branch develop
checkout develop
commit
commit
commit
checkout main
commit
commit
commit
```
As you can see several more commits have been made to the **main** branch whilst you've been working in the **FeatureA** branch. We'll talk more about **merging** these changes together later, but for now lets look at creating and managing branches.
## Creating a branch with Gitlab
In the Gitlab site when you open a project you'll have a little menu that pops up on the left hand side of the code like the image below.