-
Notifications
You must be signed in to change notification settings - Fork 3
Adding code to the repository
lbewlay edited this page Nov 4, 2016
·
1 revision
We are working on different branches:
-
master
contains the code that is delivered. We should only merge back to master when there is a new release once we have finalised a milestone. This is the code that would go in the server. -
develop
is the parent branch of all the work we do. The rest of the branches branch out from this one and once finished are merged back to it. -
feature/describingNameOfWhatYoureDoing
is the names of the branches we should be working on individually. As mentioned, this feature branch should branch fromdevelop
.
These are the steps to follow to add code to the repo:
- Identify an issue you want to work on or create a new one for the development you want to do here.
- If you want to work on an issue, filter by the label
needs_volunteer
, choose an issue, remove theneeds_volunteer
label and assign it to yourself. - If you identify an issue that is not recorded yet but you can't or don't want to work on it for whatever reason, create an issue with the
needs_volunteer
label for others to do. You can optionally add more labels that apply and assign it to a milestone you consider. - Create a new branch out of the
develop
branch (so you first dogit checkout develop
, then dogit checkout -b <name of new branch>
. - We are completing our work in feature branches, meaning we name them
feature/whateverTheAimOfThisBranchIs
. - When finished, send your changes to the repository on Github. If you're not familiar with the steps involved, generally, they would go something like:
- Run
git add nameOfFile
in your command line terminal to stage your file for a commit. You can track everything that is staged viagit status
- Commit your change to your local repo by running
git commit -m [A commit goes here]
. It is a good practice to include the Github issue number in your commit message as this ensures your commit is linked to the related issue in Github. So an example commit message would begit commit -m [Added a particular feature. #1]
or so. - Push your changes to Github by running
git push origin feature/whateverTheAimOfThisBranchIs
- For more Git commands, check out this cheatsheet and more comprehensive git documentation.
- After you've pushed your branch to the remote Github repository, go to the project home page on Github and request a pull request against the
develop
branch. A pull request creates a new Github issue, so you can label it withneeds_volunteer
or assign it to someone directly. - The person assigned looks through the code, makes comments, the author changes things if needed, and when ready, the reviewer merges your changes with
develop
and deletes the feature branch. See all PRs here.
We meet face to face every week, so if there is a possibility of conflict between two branches, the best would be to solve the conflicts on the weekly meeting, or otherwise via Slack/Skype with the author of the conflicting changes.
You can have a look at a graph of the current branches here: https://github.com/namibmap/IPPR/network
Also installing something like SourceTree, GitUp, or similar could help if you prefer using a GUI instead of commands.