-
Notifications
You must be signed in to change notification settings - Fork 0
Commiting to Git
-
Try to make smaller, but more frequent commits throughout the day, as it's easier to fix and review
-
Add a descriptive message of
what kind of changes were made, andwhy they were neccessary -
Use
git rebaseto have linear history -
Use prefixes in commit messages
-
When ADDING a new functionADD: < what has been added > -
When FIXING an errorFIX: Bug < [what bug] > [description] -
When REMOVING code, filesDEL: < what has been removed > -
When UPDATING somethingUPD: < what has been updated >
-
-
Some tips about writing helpful commit messages:- Separate the title from the body with a blank line
- Subject line <=
50 characters+ imperative mood - Use the body to explain what and why vs. how.
- Body <=
72 characters+whyandhow
-
Committing not fully-functional additions is possible if
all tests passand nothing breaks because of it. -
Every commit should be logically connected to one another, if it contains the word
and, split it into multiple commits -
Use the
git add -pcommand to prepare and verify the contents of the commit before finalizing it-
git diff --cachedto review
-
-
Avoid
force pushunless really neccessary