-
Notifications
You must be signed in to change notification settings - Fork 42
Git Practices and Conventions
daltonlim edited this page Mar 14, 2020
·
12 revisions
The git workflow that we will be following can be found here. The general steps of this flow is as follows:
- Fork and clone the main repository
- Create a new feature branch every time you start work on a new issue.
- Make your changes in the feature branch in your local clone. If the change is large, consider using a feature flag and multiple pull requests.
- Update your local repository with the most recent code from the main repository. Remember to rebase often
- Test your changes - run all existing tests and any new tests you have created, run the code and make sure the application works as expected.
- Create a pull request. The pull request should follow the conventions set out here. The body should provide more details about what changes have been made and should reference the number of the associated issues, eg "Fixed synchronization issue closes #123". The tile of the pull request should not just reference the issue number - it should succintly describe the actual changes.
- Another team member must review and approve of the pull request, we have set the minimum number of reviewers to 2 so make sure at least 2 members code review the pull request.
- Once the reviewer approves the pull request, they can merge your contribution into the main repository. **Do not merge your own pull requests. **
Feature branches should follow the convention of {issue-type}/{issue-number}-{issue-title} eg. If you have an issue which is a bug with number 30 and title Fix Headers your branch should be named bug/30-Fix-Headers. You should branch from latest version of master before starting (Most of the time, unless branching off a feature to extend its functionality or fix a bug etc).
- Fork this repo to your account
- On terminal clone the fork to your computer via
git clone <your repo>
- Set up upstream by
git remote add upstream https://github.com/se701g2/Doto.git
- To make sure you don't accidentally push to your upstream, use this command:
git remote set-url --push upstream no_push
- Sync with the upstream using the following commands:
git fetch upstream
git checkout master
git merge upstream/master
- Once you have synced your master with upstream, run the following commands to rebase as opposed to merging.
git checkout <feature-branch>
git rebase master