-
Never commit directly to the master branch. Always work on a separate branch and merge into master via pull requests.
-
Try to avoid making merge commits. We use a rebasing workflow for this project's pull requests rather than merging. This includes keeping your local branches up to date with
git pull --rebase
rather than justgit pull
. Merge commits have a history of creating hard to diagnose bugs and make reviewing pull requests harder. Sometimes merge commit are unavoidable, but those situations should be rare. -
Name your branches however you like, but please use meaningful names. Bad names include
issue-42
,bug-fixes
, andjustins-branch
. Better names includemap-layer-refactor
,async-loading
. -
The same goes for commit messages. A commit message should describe what a commit does, preferably in the imperative mood. Bad messages look like: