From 46b8d3b982104c6d4bda42c001d519e001450c77 Mon Sep 17 00:00:00 2001 From: Andree Valle Campos Date: Tue, 5 Mar 2024 21:26:32 +0000 Subject: [PATCH] add branch paragraph from supplemental --- episodes/09-conflict.md | 11 ++++++++++- episodes/14-supplemental-rstudio.md | 8 -------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/episodes/09-conflict.md b/episodes/09-conflict.md index 413bf2d01..ae79bc417 100644 --- a/episodes/09-conflict.md +++ b/episodes/09-conflict.md @@ -44,7 +44,16 @@ Before resolving conflicts, we'll review two features that a **good collaborator ## Create branches -First, verify that you are working on the main branch: +Sometimes you want to experiment with your project without affecting the main version. You can do this by using branches. A branch is a local copy of the main project (also called the `main` branch) where you can make changes and test new ideas. The `main` branch stays safe and unchanged while you work on your branch (a.k.a., `feature branch`). When you are satisfied with the changes, you can merge them into the main branch. This means that the separate lines of development in your branch are combined with the main branch. + +![One feature branch and one main branch in Git.](fig/one-branch.png) + +You can have more than one branch off of your main copy. If one of your branches ends up not working, you can either abandon it or delete it without impacting the main branch of your project. + +![Two feature branches and one main branch in Git.](fig/two-branches.png) + + +To create a branch, first, verify that you are working on the main branch: ```bash $ git status diff --git a/episodes/14-supplemental-rstudio.md b/episodes/14-supplemental-rstudio.md index 6f5364e29..7bb45cbe6 100644 --- a/episodes/14-supplemental-rstudio.md +++ b/episodes/14-supplemental-rstudio.md @@ -189,14 +189,6 @@ In the `Rstudio: Review changes` window, you can also open the `.gitignore` file ## Create a branch -Sometimes you want to experiment with your project without affecting the main version. You can do this by using branches. A branch is a local copy of the main project (also called the `main` branch) where you can make changes and test new ideas. The `main` branch stays safe and unchanged while you work on your branch (a.k.a., `feature branch`). When you are satisfied with the changes, you can merge them into the main branch. This means that the separate lines of development in your branch are combined with the main branch. - -![One feature branch and one main branch in Git.](fig/one-branch.png) - -You can have more than one branch off of your main copy. If one of your branches ends up not working, you can either abandon it or delete it without impacting the main branch of your project. - -![Two feature branches and one main branch in Git.](fig/two-branches.png) - In the Git tab, in the right hand side you will find the name of your current branch (e.g., `main`). Use the button in its left hand side to create a branch. ![](fig/pane-git-02.png)