Collaborators will work on their own branches that they will create from a main working branch, which will then be merged to this main branch via a pull request.
Main branches are branches that do not contain a description in their name as they do not need one (e.g.: feature/assignment-3).
In order to pull the main branch for a given assignment so that collaborators can then create each of their branches, the following commands will have to be executed:
- if the branch does not exist locally
git fetchgit switch main_branch_namegit checkout -b own_branch - if the branch already exist in the local repository
git checkout main_branch_namegit pullgit checkout -b own_branch
In order to push their branch to the remote repository, collaborators will need to link it by executing the following command:
git push --set-upstream origin own_branch
They can then visit the page of their branch on GitHub and create a pull request. Make sure that the target (the main branch) is the correct one as GitHub will set dev by default.
If an assignment is split into different parts, then each part should have its own branch.
We will name branches using the pattern [type]/[assignment/scope]/[short description].
typecan be one of the following:release,featureorhotfixassignment/scopeisassignement-followed by the number of the assignment for a "main" branch orassignmentfollowed by the number of the assignment if a "short description" follows (e.g.:assignment-3orassignment3)short descriptionis a short, url encoded, description (e.g.:add-green-button,part-4orjulien)
Following this pattern,
- a branch on which Edouard will implement his version of assignment 4 will be named
feature/assignment4/edouard - a branch on which Lilou will do part 3 of assignment 8 will be named
feature/assignment8/part-3 - a branch on which Julien will fix a bug on a release, described in issue 2, right before the grading of the 8 first assignments will be named
hotfix/assignment8/issue-2 - the working (feature) branch for assignment 12 will be named
feature/assignment-12
Up to week 5 - included - assignments will be individual, meaning that we are all going to do the same work. This will result in short description simply being the name of the branch owner.
If a part is split into different subparts, then each subpart should have its own commit - when possible
Commit messages will be written in english, following the pattern: [type] - [name] - [description]
typewill either bescriptif a script was modified orsceneif a scene was modifiednamewill be the name of the script or scene that was modified (e.g.core/configfor the script located atAssets/Scripts/Core/Config.csormenufor the scene located atAssets/Scenes/Menu)descriptionis a simple yet complete description of the changes - it can be the name of a subpart (e.g.:Part 3.2for changes recquired by subpart 2 of part 3)
Following this pattern,
- a commit related to part 5.2, recquiring changes on script PlayerMovement.cs will look like
script - PlayerMovement - Part 5.2
Contributors shall not directly merge to "main" branches (branches protection should prevent them from doing it). Once their part is done, they should submit a pull request, wait for approval and then squash their commits into a single one before merging without modifying the title of the commit generated by GitHub.