git-version-control
- Never use
git add -Aorgit add .or checking to make sure only your changes are going to be included.- Always prefer running
git add <filename> <filename2>.
- Always prefer running
- Commit message titles should be imperative, start capitalized, limited to 50 chars, and finish with no punctuation.
- Bulletpoint lists and other markdown syntaxes are encouraged inside commit message descriptions.
- Do not create branches or commits unless explicitly told to do so.
- When updating from the remote, always use
git pull --rebaseto avoid unnecessary merge commits. - Fix merge/rebase artifacts on the source branch, not the merge target.
- When a merge or rebase introduces a problem (duplicate imports, bad conflict resolution, etc.), trace it back to the feature branch that owns the change and fix it there.
- Amend the commit on the feature branch, force-push it, then redo the merge cleanly.
- Never patch these on master/main directly as it'd dirty up the commit history.