<p>Another common Git issue I see is people using <code>git add .</code> to commit every change in every file they have locally.</p>
<p>Similar to <a href="/daily/2025/04/02/commit">committing with <code>-m</code></a>, this seems to be a common in Git tutorials, but can have consequences due to unexpected changes being staged and committed.</p>
<p>Maybe there are unrelated changes in the same file or other files have been changed that you don't want to commit yet.</p>
<p>What if something was committed and pushed that caused the CI pipeline to fail or break production?</p>
<p>At the least, it's going to add time and delay getting the intended changes live as someone will need to revert and fix the commits or address the changes in a code review.</p>
<p>I'm very selective about what I include in each commit to keep my code stable and the commits easy to review and, if needed, revert.</p>
<p>I always use <code>git add -p</code> to interactively stage changes from the command line or use keybindings in my Neovim configuration to add particular lines.</p>
<p>I'll also review my staged changes before committing and the commit once it's been made using <code>git log --stat</code> to see what's included.</p>
<p>Only once I'm sure my commits include only what I intended will I push them or submit them for review.</p>
format:full_html
processed:|
<p>Another common Git issue I see is people using <code>git add .</code> to commit every change in every file they have locally.</p>
<p>Similar to <a href="/daily/2025/04/02/commit">committing with <code>-m</code></a>, this seems to be a common in Git tutorials, but can have consequences due to unexpected changes being staged and committed.</p>
<p>Maybe there are unrelated changes in the same file or other files have been changed that you don't want to commit yet.</p>
<p>What if something was committed and pushed that caused the CI pipeline to fail or break production?</p>
<p>At the least, it's going to add time and delay getting the intended changes live as someone will need to revert and fix the commits or address the changes in a code review.</p>
<p>I'm very selective about what I include in each commit to keep my code stable and the commits easy to review and, if needed, revert.</p>
<p>I always use <code>git add -p</code> to interactively stage changes from the command line or use keybindings in my Neovim configuration to add particular lines.</p>
<p>I'll also review my staged changes before committing and the commit once it's been made using <code>git log --stat</code> to see what's included.</p>
<p>Only once I'm sure my commits include only what I intended will I push them or submit them for review.</p>