-
Notifications
You must be signed in to change notification settings - Fork 57
Development Process
Here is a suggested dev process that has worked well when multiple people work concurrently on a given set of roadmap items.
First lets create a branch in which we do the dev work related to a given github issue. The issue must exist and there should not be any work that finds it way to master without resolving an associated issue. At the time of milestone release, we generate the change log from the set of issues that have been resolved for that milestone.
git checkout -b devXX master
There can be as many commits to the dev branch as you like. Partial commits are fine commits that do not actualy work are fine too. The dev branch lives in your private fork of the project and its generally not seen nor shared with anybody else.
echo "try this" > some-file.txt
git add --all
git commit -m "Try this"
echo "try that" >> some-file.txt
git commit -a -m "Try that"
echo "fix it" >> some-file.txt
git commit -a -m "Fix it"
When done with the dev work, we would like to squash everything into a single commit that can then easily be reviewed by others and shared among branches. If a given set of changes is encapsulated in a single commit it can easily be cherry-picked more or be reverted.
git checkout -b ghiXX master
git merge --squash devXX
git add --all
git commit -m "[resolves #XX] Makes tee instead of coffee"
git push origin ghiXX
When the PR source branch has been pushed to your private fork, it is time to create a PR from it. Head over to the upstream project and do so.
The [resolves #XX]
keyword is recognised by github and will close the referenced issue automatically when the commit makes it to master.
It is quite normal that multiple open PRs exist at the same time. Some of them may contain conficting changes, which may invalidate your PR. It may therefore be necessary that you resove these conflicts and rebase your PR branch.
Lets simulate progress while your PR is waiting
git checkout master
echo "Hello Kermit" > hello.txt
git add --all
git commit -m "[resolves #YY] Say Hello"
Now lets rebase our work on that
git checkout ghiXX
git rebase master
Lets now further assume that the latest changes to master require some changes to your PR. We would like to do that without violating the "one commit per issue" rule.
echo "Kermit is here" >> some-file.txt
git commit --amend -a -m "[resolves #XX] Makes tee instead of coffee"
git push --force origin
Your forced push should be reflected on your PR.