From 772f9b90e259019d5af65747aa027ffcdf3539b4 Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Fri, 3 May 2024 17:06:33 +0100 Subject: [PATCH] add into to branches --- branches.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/branches.md b/branches.md index 80b6258..dec5580 100644 --- a/branches.md +++ b/branches.md @@ -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.