-
Notifications
You must be signed in to change notification settings - Fork 274
Commit format
Denys Vuika edited this page Jun 27, 2016
·
6 revisions
##Message
- Do your best to give a commit a meaningful name that explains what it contains.
- To make easier understand to wath the change is refering to, remember to put the issue id in you commit.
# good message
git commit -m "#issue-id Fix upload button"
# bad
git commit -m "Fix upload button"
##Good practice
-
Each commit should be a single logical change. Don't make several logical changes in one commit. For example, if a patch fixes a bug and optimizes the performance of a feature, split it into two separate commits.
-
Don't split a single logical change into several commits. For example, the implementation of a feature and the corresponding tests should be in the same commit.
-
Commit early and often. Small, self-contained commits are easier to understand and revert when something goes wrong.
-
Commits should be ordered logically. For example, if commit X depends on changes done in commit Y, then commit Y should come before commit X.