Add code to Ushahidi
Ushahidi code development is happening in Github. We track all our tasks, both front-end and back-end, in issues connected to the repo Platform API.
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
The Ushahidi is built from 3 separate repositories. Depending on the task you'll need to fork one or more of these. Usually you'll need to fork at least the API and the Client repositories.
To fork a repository:
- 1.Click the link above
- 2.In the top-right corner of the page, click Fork.
Thats all! Now you have your very own fork of the original repository.
If you hadn't yet cloned (and installed) the platform code, you can just go ahead an clone your fork:
git clone [email protected]:yourusername/platform.git
If you already cloned and installed the platform, you can add your new fork as a "remote" repository:
git remote rename origin upstream
git remote add origin [email protected]:yourusername/platform.git
When you clone a repository, the URL you clone is always created as the "origin" remote repository. The commands above rename the "origin" to "upstream", and create a new "origin" that points to your fork. This will allow you to pull in new versions of the platform, but push your own branches to your fork.
The best way to pick a feature to work on is to say hi to Ushahidi’s developers in our community-channels in gitter/irc, let them know what you’d like to work on (front end, back end, etc), and chat about what could be suitable for you. You can find more info on how to contact us here.
Ushahidi issues (bugs, feature requests, etc) are in Github Issues. Find something that needs doing.
- Other tasks that we haven’t labeled yet may be suitable for work. Feel free to contact the team if you intend to work on something that grabs your attention.
If you’re working on a feature that nobody has claimed before, you will need to create a branch of Ushahidi that’s specific to this feature. To do this, cd (change directory) into your Ushahidi code in the terminal window, and type:
git checkout master
git pull
git checkout -b some-task
Where “some-task” is a short description without spaces of what this task is (e.g. “visualise-data”). Now you can start work on your code.
Now write your code. Make sure you meet the Ushahidi coding standards and use the Ushahidi pattern library if you need to change the css.
When you’re ready to submit your code for approval, do this:
- 1.Commit and push your codegit add .git commit -m “message about this commit”git push origin some-task
- 2.Then, open your fork on github, ie. "https://www.github.com/yourusername/platform". You’ll see a banner indicating that you’ve recently pushed a new branch, and that you can submit this branch “upstream,” to the original repository:
- 3.Click on "Compare and Pull Request" to create a pull request. Enter a title and description, then click "Create pull request".
In order to make it easy for someone to review your pull request, please write a checklist for how to test and evaluate your submission. You can read more about
The Ushahidi admins will then review and comment on your code, and will either accept your code or ask you to make changes to it. If you are asked to make changes to your code, make those changes then resubmit your code using:
git add .
git commit -m “message about this commit”
git push origin some-task
If your code is accepted, then the admin will merge your pull request. Your code will then appear in the Ushahidi Platform github repository, with you credited for it.