RGCIFUWWWTOEJBY or "Random Git Conventions I Found Useful While Working With Teams Or Even Just By Myself"
Each of this RGCIFUWWWTOEJBY's can be used by themselves or in combination with everything else.
As often as logically possible. I mean, commits are free of charge.
- Limit the message to 50 characters.
- Capitalize the first word.
- Use the imperative mode. As a rule a thumb, imagine you are trying to complete the phrase "When applied, this commit will ______".
Good commit messages
git commit -m "Add new validation logic to the UserRequest class"
git commit -m "Refactor Auth class signup method for readability"
git commit -m "Add parsing logic for the offer method inputs"
Bad commit messages
git commit -m "New validation logic"
git commit -m "making signup method easy to read"
git commit -m "more fixes for broken stuff"
For master
and develop
this is pretty straight forward, they should be called, well, master
and develop
.
In the feature
, bugfix
and hotfix
cases you are going to want to be a bit more verbose though.
<feature|bugfix|hotfix>/<task-id>-<hyphen-separated-short-name>
Note the slash between the type of the branch and the rest of name, kind like namespacing the branches. That's done because Git actually parses the branch names and stores them in separate folders based on the slashes in the name. This has several advantages like making it easier to search features by their names in the terminal and even several GUI Git clients will organize your branches based on this nomenclature as well.
The rest of the name consists of the feature id (taken from however you are organizing your work TODO: explain a bit more about Trello, Asana, Basecamp, etc?) and a 2/3 word description of the task.