Skip to content

About Branches & Forks

TheElectricDream edited this page Oct 3, 2021 · 4 revisions

About Branches

Branches are the recommended way to have your own working version of SPOT without risking the integrity of the main branch. To understand a GitHub branch, think of it like a tree. The trunk is the main branch, and every student can create a sub-branch that breaks out from the main trunk. Deleting or otherwise "breaking" a branch does not impact the main branch in any way. Here is a visualization of the branch concept:

Branch concept

The benefit of a branch is that you can update it from the main branch to get the latest features (as long as there are no conflict with your branch), and you can also create what is known as a "pull request", which let's the repository administrator know that you have made a change to your code that you believe should be merged with the main branch for the benefit of everyone. However, branching requires collaborator privilege's, which not everyone will always have; this is where forking a repository comes into play.

About Forks

The most common use case for a repository fork is to either propose changes to someone else project, or, in this case, use a project as a starting point for your own ideas. A fork creates a copy of a repository to which you can make changes without affecting the upstream repository.

Clone this wiki locally