3. Branching Strat - CenterStage-23-24/CenterStage GitHub Wiki

Branches:

What are branches? Branches are spaces where you can experiment with the code and develop new features without affecting the basic code. So at the most basic, you have a master branch, which holds all your code, and it's possible to push code into it and pull code from it. A branch is like a copy of the main branch, and you can make changes to it and do testing with the changes, and when the code works, you can put it back in the main branch.

Big companies usually use a branching strategy so that there are no conflicts between the versions of the branches and all of that because it definitely adds a level of complexity. The system we use is as follows:

Structure:

Master - The master branch is our "production" code. This code should be working at all times and is what we should use at the competition level.

Develop - The develop branch is similar to the master branch, but in this branch, you can test the features that you are developing and try out new programs. This is the "testing" version of the master branch, and if the features work well in the develop branch, then they can be pushed to the master branch.

Feature - the feature branch is the lowest level in branching. Feature branches are where the main development should happen and there can be a lot of trial and error. These branches should be used for testing individual features, like linear slides, a new autonomous class, acceleration controls, etc. When a feature is working fairly well, it can be pushed to the development branch for testing in collaboration with other features other developers may be working on.

Pull Requests:

To push the code from a branch to another branch, ie. feature to develop, etc, a pull request should be made. When a request is made, the code is not automatically merged with the other branch. Instead, someone else is required to review your request and make sure it is valid. This makes sure that the code is not randomly pushed into a higher level branch

Release Versions:

When new features are made and perform well in the develop branch, they can be "released" to the main branch. Each release has a version associated with it in the format v1.0.0. The first number specifies a big release, the second number is smaller releases, and the last number is minor bug fixes, or hotfixes.