Thursday 3 November 2022

Git and GitHub Best Practices

  No comments



🔥 If you're a developer, writing great Git commit messages is a key skill. This can have a big impact on how well you collaborate with others. Commit messages to have enough detail to allow someone else to understand what you changed, why you made those changes, and what the impact is.


🔴 I have seen so many developers writing the same messages repeatedly, which is a very bad practice. They blame it on saying we don't have enough time to write documentation or unit tests or commit messages.


But commit messages are very VERY important because:

➡️ Git commit messages to tell a story

➡️ They are searchable, making them a great way to navigate a project

➡️ They keep developers sane and the team in place


Now let's go over some quick dos and don'ts of writing Git commit messages.


Do:

✅ Keep messages short and to the point

✅ Be as specific as possible

✅ Describe what was done and why, but not how.


Don't:

❌ Don’t go beyond 50 characters in the subject line.

❌ Don’t describe the low-level code you wrote.

❌ Don’t simply reference a JIRA ticket in your commit.


Finally, here are some examples for you to see it in action.


Good:

✅ FEATURE Improve performance with lazy load implementation for images

✅ CORE Update Gradle dependency to the latest version

✅ BUG Fix the issue preventing users from submitting the subscription form

✅ REFACTOR Updated the repository layer with Kotlin flows


Bad:

❌ fixed bug on the landing page

❌ Changed UI

❌ finally finally finally fixed that horrible bug

❌ sent client build

❌ oops

❌ I think I fixed it this time?

empty commit messages 


Talk by shreyas on git practices

No comments :

Post a Comment

Loading...