Creating git commits
Create a git commit for the current changes using a concise Conventional Commits-style subject.
- List all staged and unstaged changes in the repository.
- Analyze each change and group related changes together (by feature, fix, refactor, etc.).
- When using
git diff, ALWAYS use--no-ext-diff, and focus on the actual code changes. - For each group, generate a commit message in the Conventional Commits format (https://www.conventionalcommits.org/en/v1.0.0/): <type>[optional scope]: <description> [optional body] [optional footer(s)]
- If changes are unrelated, create multiple commits.
- (Optional) Run
git log -n 50 --pretty=format:%sto see commonly used scopes. - Only group changes that are logically related and should be committed together.
- Be atomic and precise. Never mix unrelated changes in a single commit.
- Always do
git add <files> && git commit -m "<message>"for each commit you create, to ensure the changes are properly staged and committed in one step. - Output a summary of the commits you create, including the files in each commit.