<p>When using <code>git log</code> to look through the history of codebases, I often see large commits that combine several changes.</p>
<p>These also lead to vague commit messages like "Changes", "wip" or "Fixes".</p>
<p>These aren't helpful when reviewing the history and large commits are difficult to review and revert if there is a problem.</p>
<p>Each commit should be focused on a single change, whether its adding part of a new feature, fixing a bug or refactoring.</p>
<p>If it's a combination, they should be split into separate commits.</p>
<p>Each commit should have its own well-written commit message that explains why the change was needed, any consequences or manual deployment steps, alternative approaches that were tried, issues encountered and any follow up actions.</p>
<p>If you can't properly describe the changes made in a commit, the commit is too big.</p>
<p>You should uncommit the changes and use <code>git add -p</code> to create a more focused commit.</p>
<p>This is why <a href="/daily/2024/05/11/don-t-delete-my-commit-messages">I don't squash commits</a>.</p>
<p>If people have made an effort to create good commits with good commit messages, I don't want them to be lost when the commits are merged.</p>
<p>I want to keep the history of the changes intact and as it originally was.</p>
<p>I do sometimes need to <a href="/daily/2025/02/11/tidy">tidy up my own commits</a>, though, before I push them for anyone else to see.</p>
format:full_html
processed:|
<p>When using <code>git log</code> to look through the history of codebases, I often see large commits that combine several changes.</p>
<p>These also lead to vague commit messages like "Changes", "wip" or "Fixes".</p>
<p>These aren't helpful when reviewing the history and large commits are difficult to review and revert if there is a problem.</p>
<p>Each commit should be focused on a single change, whether its adding part of a new feature, fixing a bug or refactoring.</p>
<p>If it's a combination, they should be split into separate commits.</p>
<p>Each commit should have its own well-written commit message that explains why the change was needed, any consequences or manual deployment steps, alternative approaches that were tried, issues encountered and any follow up actions.</p>
<p>If you can't properly describe the changes made in a commit, the commit is too big.</p>
<p>You should uncommit the changes and use <code>git add -p</code> to create a more focused commit.</p>