|
|
|
# Code Development
|
|
|
|
|
|
|
|
## Repository Structure
|
|
|
|
There are 3 main branches
|
|
|
|
- master: always 'runnable' code, e.g. could be used by customers
|
|
|
|
- develop: current developments, waiting to be pushed into the master
|
|
|
|
- foundation: mirror of the latest Foundation master branch merged from upstream
|
|
|
|
|
|
|
|
## Worfflow
|
|
|
|
Create a tracking branch to track the 'develop' branch if not already available:
|
|
|
|
- git branch develop --track remotes/origin/develop
|
|
|
|
|
|
|
|
All new code/features/bug-fixes should be created on their own branch, e.g. starting from the develop branch
|
|
|
|
- git checkout develop
|
|
|
|
|
|
|
|
Create and move to a new branch
|
|
|
|
- git checkout -b feature-ABC (or git checkout -b bugfix-ABC etc)
|
|
|
|
|
|
|
|
Add functionality in the usual way, e.g. adding and committing code changes.
|
|
|
|
|
|
|
|
|
|
|
|
### Submitting for code review
|
|
|
|
When ready for review, push the branch upstream
|
|
|
|
- git push -u origin feature-ABC
|
|
|
|
|
|
|
|
On logging in to this service, you will be able to submit a merge request, and assign a user from the list of developers. Most merge requests will target the develop branch, unless e.g. hot-fixes which will target the master branch directly.
|
|
|
|
|
|
|
|
### Direct addition to the repository
|
|
|
|
If no code review is required, the feature branch can be merged in the local repository directly and pushed upstream to the relevant branch, e.g.
|
|
|
|
- git checkout develop
|
|
|
|
- git merge feature-ABC
|
|
|
|
|
|
|
|
If the branch is no longer needed, delete it!
|
|
|
|
- git branch -d feature-ABC
|
|
|
|
|
|
|
|
|
|
|
|
## Code Merging
|
|
|
|
Periodically when code in the 'develop' branch is stable, merge the develop branch into the 'master' branch. Similarly, the 'develop' branch will be updated from the 'foundation' branch. |
|
|
|
\ No newline at end of file |