Skip to content

Branches

Creating a GitHub Branch

After creating an issue, you're going to want to create a GitHub Branch. A branch is a parallel version of the repository's "main" branch, which allows you to develop on without affecting the main codebase.

To create a new branch locally, run:

How to Create/Use a Branch In Your Terminal

Creating the branch

git branch {name_of_branch}
Entering the branch
git checkout {name_of_branch}
Creating and entering a branch at the same time
git checkout -b {name_of_branch}

Our Branch Naming Convention

{github_issue_generated_number}-{short_description}

Since our branch naming convention requires an issue generated number, it's likely easier to just create the branch from the GitHub Issue web page.

Creating Branch from Issue

Accessing a GitHub Branch

If you created your branch on the GitHub web page and not your local terminal, you'll first have to run

git fetch origin
to get the new branches from the remote repository.

Then, as mentioned before, you can checkout ("enter") the new branch with

git checkout {name_of_branch}
and from there, you can start editing files and implementing your changes!