Guide: Code Contributions
We use GitLab Merge Requests to propose, review, and approve code changes.
First Time Setup
The first time you work with our repositories code, you’ll want to set up your development environment. You’ll also need to read Guide: Building Code.
Getting Ready
Before you make any changes, you should create a new branch on your local
copy of the repository. You should never work on devel
. To create
a new branch, run…
git checkout -b newbranchname
…where newbranchname is the name of the branch you’re creating. You can call it absolutely anything (except “devel”, “fresh”, or “stable”).
Making Changes
Every day you finish work, you should commit and push your changes to a remote branch (NOT devel, fresh, or stable). To do this, run:
git add .
git commit
git push origin newbranchname
If you’re ready for code review and feedback, go to GitLab and create a Merge Request. You may consider nominating a reviewer, although this is optional. If you’re NOT ready for review, click Mark as draft on the Merge Request.
Learn more about creating Merge Requests here: https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html
Once your Merge Request has passed all CI/CD checks and been approved, any
Developer on the project can merge it to the devel
using the button on
the Merge Request.
Pulling Down a Merge Request
If you want to pull down someone else’s Merge Request to your local repository for testing it out, or if you want to recover your lost work from your Merge Request, just fetch the associated branch.
git fetch origin
git checkout nameofthebranch
…where nameofthebranch is the name of the branch you want to clone.