forked from craftyjs/Crafty
-
Notifications
You must be signed in to change notification settings - Fork 1
Workflow
starwed edited this page Jul 12, 2013
·
21 revisions
If you're interested in contributing to Crafty, here is an outline of the workflow you should use:
- Fork Crafty on github.
- Clone the forked repo locally
- (Or, if you already have a local clone, pull any changes from upstream into
develop
) - From the
develop
branch, create and checkout a new branch to work upon. - Make your changes in that branch.
- Change are made to the individual files in the
/src
directory, not tocrafty.js
. - If sensible, add some qunit tests in
/tests/
! - Check that your code works, and that there are no regressions!
- Remember to build
crafty.js
before checking - The existing unit tests (
tests/core.html
) should still pass. - Make sure any games you've been working on aren't unexpectedly broken by your changes
- Push the changes to your github repo
- Submit a pull request from your repo back to the original repository
- Once it is accepted, remember to pull those changes back into the develop branch!
If you're unfamiliar with git, these pages should help you! And there are a lot of great resources out there if you search for them.
- Github: Setting up git
- Github: Forking a repo
- Git Basics
Some tips
- Each new feature should go in its own new branch, not on the develop branch. That lets you work on multiple features at once!
- A pull request on github is keyed to the branch, not a specific commit. So any further changes you make to the branch will show up on the pull request.
- Don't be afraid to change history when working solo, even after a pull request has been opened:
- There's no need for a branch's history to reflect any mistakes you've made along the way. A clean history is easier to read and understand.
- If you make a mistake in your last commit, then
git commit --amend
is your friend. - rebase can do many things -- squashing multiple commits to one, reordering commits, etc.
- But don't alter history in your public repo if someone else is working off that branch