Created by [ Rowan Dempster], last modified by [ Henry Wang] on Jan 08, 2020
The purpose of this tutorial is to get new WATonomous members familiar with our project on uWaterloo's GitLab. This tutorial mostly comprises of the popular commands used in Git and how it is used in WATO. This guide provides information for setting up the WATonomous git repo, rules about using git, useful git commands, as well as good practices and guidelines when working with git.
We are using the GitFlow workflow. Please become familiar with this workflow. Learn about it here: https://www.atlassian.com/git/tutorials/comparing-workflows#gitflow-workflow.
[In addition to the Gitlab notes below, here's the official starter guide from Gitlab: ]https://docs.gitlab.com/ee/gitlab-basics/
WATO uses Git under uWaterloo's organization, which can be found at https://git.uwaterloo.ca/WATonomous
Depending on which team you're in, your manager (or team lead) may have already set up the project for you. In order to contribute to the project, make sure you're given developer access to it by going under Settings → Members and looking for your name.
If you do not already have git installed through your terminal, follow the below link: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
WATonomous has a private repo through the university’s GitLab tool. General sign-in link can be found here: https://git.uwaterloo.ca/users/sign_in
Before you can access any repositories from your local machine, you will need to upload an SSH key to your GitLab profile.
The WATonomous Repo is setup such that each subteam (e.g. Prediction, Decision, …) has its own repo.
Now you will set up a WATO workspace on your local computer to hold all
the repositories. Create a WATO folder on your computer and open up a
command terminal. Enter the following into the command line:
cd <path-to-wato-folder>
git init
git clone
gitlab@git.uwaterloo.ca:WATonomous/<name-of-repository>.git
cd <name-of-repository>
git checkout develop
This will create a local copy of the repository. You should now see a
folder named <name-of-repository> in the WATO folder you created.
Now you are ready to get started!
Normally, any task you are working on will have a corresponding Jira task.
When you are working on your own branch, you may want to occasionally back up your work on the server. The following commands can be used for pushing code to a remote branch.
Once you have fully tested the code on your branch and are ready to merge the code into the develop branch. Keep in mind that most people do not have push permission for develop and master branches. Follow the below steps to get your code merged.
It's generally bad practice to git merge branches into each other because doing so creates merge commits and creates a non-linear history. Git Lab repos have settings to configure to merge method. By default the merge method is "Merge commit". It'd suggest setting it to "Fast-forward merges only". Or manually rebasing and having the repo maintainers push to the remote branch.
git pull <branch-name>
Use .gitignore file to keep the repo clean by not tracking any files with extensions listed in the .gitignore file (e.g. binary files, IDE-specific project files…)
Git workflow: https://www.atlassian.com/git/tutorials/comparing-workflows#gitflow-workflow
Thorough git tutorials: https://www.atlassian.com/git/tutorials
Git documentations: https://git-scm.com/docs/gittutorial
\
Document generated by Confluence on Nov 19, 2021 12:20