Skip to content

Commit

Permalink
add branch paragraph from supplemental
Browse files Browse the repository at this point in the history
  • Loading branch information
avallecam committed Mar 5, 2024
1 parent 3965a9a commit b1fcbfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 10 additions & 1 deletion episodes/09-conflict.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions episodes/14-supplemental-rstudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1fcbfa

Please sign in to comment.