-
Notifications
You must be signed in to change notification settings - Fork 1
Git branching system used
NOTE: I thought we should use a defined system of how we implement new feature additions to the project. The steps I've come up with is a simple git-flow and has three stages:
This branch will have the latest working version of the code. Only code modifications that have been reviewed by others should be merged into this branch to avoid breaking the code.
This branch will be our common place to test out features and additions that we believe are working. You can merge your code from one of the feature branhces into this one once you are confident that your code works on that branch. Once merged, test it on the develop branch, make sure nothing was broken due to the new feature. Then create a pull-request for your change (marking that you would like this to be reviewed by the other two devs) and assign the other to devs as reviewers. They then should review that it indeed works on their side too and approve the change. At that point it is safe to merge into master.
We should create a new feature branch for each new feature or addition we would like to add. Only do work on the feature branches. The other two branhces are only for marging these features together.
You have a new feature that you'd like to add to the project, let's say it is a jump ability to the main character.
- checkout the develop branch
- pull the latest version of that branch so you start with the most up to date version
- create a new branch from this branch and name it to specific to the new feature:
git checkout -b feature/character_jump
- this will create the new branch locally, so now you have to make a push to the remote branch. In VSCode I just select 'push' and it will ask me if i want to publish an upstream branch for this local branch. Select yes. Now your branch is published on github too.
alternatively you can type the following command (will do the same):
git push --set-upstream origin feature/charcter_jump
- start making additions/modifications to the project
- once you have tested locally and happy with the code you should push to the remote branch, so we have a copy of these changes in the repo.
- then you should merge this feature branch into the develop branch as follows:
- checkout the develop branch and pull the latest version
- type the following command to merge your feature branch into develop
git merge feature/character_jump
- test the code again locally
- If the changes didn't break anything, push the changes of the develop branch to the repo
- Go the the github repo's
part in a browser. There will be a yellow box at the top saying you have recently pushed changes to develop branch. Click the button 'Create pull request'. This will take you to the pull request page. Select the master branch at the top (you want to merge changes to master). Then add any comments needed and select the reviewers (other two devs) and click Save.
- The other two devs will review and approve your changes and merge into master.
- the master branch finnally will have your feature