Best Practicesยท3 minutes read

Git Most Wildly Accepted Bad Pattern

One common misconception when working with Git is that you need to run git add ., commit, and push after every single atomic change.

Linas Kapoฤius

Linas Kapoฤius

Solutions Architect at Corgineering.com

October 15, 2024
Git Most Wildly Accepted Bad Pattern

๐Ÿ”‘ ๐“๐ซ๐ฎ๐ญ๐ก ๐ข๐ฌ, ๐ฒ๐จ๐ฎ ๐๐จ๐งโ€™๐ญ ๐ก๐š๐ฏ๐ž ๐ญ๐จ.

It's much better to commit frequently as you complete meaningful chunks of work, but you donโ€™t always need to push right away. Instead, try pushing after short breaksโ€”say every 1-2 hoursโ€”when you have a logical batch of changes ready to go.

๐Ÿ“ ๐‚๐จ๐ฆ๐ฆ๐ข๐ญ ๐Œ๐ž๐ฌ๐ฌ๐š๐ ๐ž๐ฌ ๐Œ๐š๐ญ๐ญ๐ž๐ซ

Letโ€™s be honest, I've found myself using generic commit messages like "added some changes" which is vague and repetitive. To make your commits more useful, focus on ๐ฐ๐ก๐š๐ญ you changed and ๐ฐ๐ก๐ฒ.

If that sounds tricky, donโ€™t worryโ€”that's where ๐‚๐จ๐ง๐ฏ๐ž๐ง๐ญ๐ข๐จ๐ง๐š๐ฅ ๐‚๐จ๐ฆ๐ฆ๐ข๐ญ๐ฌ come in! With a simple extension for VS Code, you can standardize your commit messages to look cleaner and more professional. Examples:

feat: add user login functionality fix: resolve issue with payment gateway refactor: optimize database queries

If you found this helpful or my own created meme funny, donโ€™t forget to like and follow us on social media for more tips on improving your development workflow! ๐Ÿ’ฌ

Blog image

This article is part of our Best Practices series. Check out our other articles.