Categories
Development Self Development Software Development

Alternative Git Conventional Commit Style: My Personal Approach to Better Code Management

Git commit messages play an important role in version control and software development. They provide context and documentation for each change made to a codebase, making it easier for developers to understand and review the history of a project. However, writing clear and descriptive commit messages can be challenging, especially when working on complex or large-scale projects. That’s where Git conventional commits come in. By following a set of commit message guidelines, developers can create consistent and easy-to-understand commit messages, making it easier to track changes and maintain a clean Git history. In this article, we’ll explore some alternative prefixes for conventional commit styles to help you create more descriptive and meaningful commit messages for your projects.

When working with Git, it’s important to have a clear and consistent way of communicating changes to your codebase. The conventional commit style is a widely used standard for writing commit messages that help keep track of changes and make it easier to understand what’s been done. However, I found that the conventional commit style didn’t always fit my needs, so I came up with my own set of commit message prefixes that better reflect the types of changes I make most frequently.

Here are the prefixes I use in my alternative Git conventional commit style:

  • 🚀 – New feature (feat)
  • 🩹 – Bug fix (fix)
  • 🪓 – Changes that affect the build system or external dependencies (build)
  • 🧺 – Update task runners and dependencies (chore)
  • ☔ – Changes to CI configuration files and scripts (ci)
  • 📃 – Documentation only changes (docs)
  • 🧼 – Changes that do not affect the meaning of the code (white spaces, formatting, semi-colons) (style)
  • 🧹 – A code change that neither fixes or bug nor adds new feature (refactor)
  • 🎯 – A code change that improves performance (perf)
  • 🧪 – Add missing tests or correcting existing once (test)
  • ❌ – Reverting changes with associated git hash (revert)

Let’s look at each of these in more detail:

🚀 = New feature (feat)

Use this prefix when you add a new feature or functionality to your codebase. This could be a new UI component, a new API endpoint, or anything else that adds new capabilities to your application.

🩹 = Bug fix (fix)

Use this prefix when you fix a bug or error in your codebase. This could be a syntax error, a logic bug, or any other issue that prevents your code from working as expected.

🪓 = Changes that affect the build system or external dependencies (build)

Use this prefix when you make changes to your build system, like updating your package manager or changing your build scripts. This could also include changes to external dependencies like adding a new library or upgrading an existing one.

🧺 = Update task runners and dependencies (chore)

Use this prefix when you make changes to task runners or other development tools. This could include updating your testing framework, optimizing your build process, or making other changes that improve your development workflow.

☔ = Changes to CI configuration files and scripts (ci)

Use this prefix when you make changes to your CI configuration files or scripts. This could include changes to your build pipeline, your testing configuration, or any other changes that affect your continuous integration setup.

📃 = Documentation only changes (docs)

Use this prefix when you make changes to your documentation files, like updating your README or adding new documentation to your codebase.

🧼 = Changes that do not affect the meaning of the code (white spaces, formatting, semi-colons) (style)

Use this prefix when you make changes to your code that don’t affect its meaning. This could include changes to formatting, whitespace, or other stylistic changes.

🧹 = A code change that neither fixes or bug nor adds new feature (refactor)

Use this prefix when you make changes to your code that don’t fit into any other category. This could include refactoring code for performance or readability, or making other changes that improve your codebase without adding new features or fixing bugs.

🎯 = A code change that improves performance (perf)

Use this prefix when you make changes to your code that improve its performance. This could include optimizing algorithms,

improving memory usage, or making other changes that make your code run faster or more efficiently.

🧪 = Add missing tests or correcting existing once (test)

Use this prefix when you add new tests to your codebase or correct existing ones. This could include adding unit tests, integration tests, or any other tests that help ensure the quality and correctness of your code.

❌ = Reverting changes with associated git hash (revert)

Use this prefix when you need to revert a previous commit. This could be necessary if you accidentally introduced a bug, or if a feature you added caused unexpected issues.

By using these prefixes consistently in your commit messages, you can make it easier for yourself and others to understand what changes have been made to your codebase. Additionally, using clear and descriptive commit messages can help you maintain a clean and organized Git history, making it easier to track changes over time.

Of course, these prefixes are just a starting point. You can always customize them to better fit your needs or add new ones as necessary. The most important thing is to find a convention that works for you and stick with it consistently across your team and projects.

It’s worth noting that the prefixes listed here are intended for use with single scope commits, where each commit is focused on a single change or feature. For larger changes that involve multiple commits, you may need to use a different convention or modify these prefixes to better fit your workflow.

In general, it’s best to keep each commit as small and focused as possible, so that it’s easier to understand and review the changes. This can also make it easier to roll back changes if necessary, since you’ll have a clearer picture of which commits introduced which changes.

Happy coding!

By Edward Fitz Abucay

"How long is forever?"

I'm a software engineer with a passion for innovating and creating products, especially for startups in the web3 and blockchain space. I'm always excited to learn and work with new technologies, and I'm committed to delivering high-quality solutions that meet the needs of my clients or users.

In my free time, I enjoy listening to music of all genres, but classical music holds a special place in my heart. I find it both inspiring and calming, and it helps me to stay focused and creative. I'm also an avid reader of books and manga, and I enjoy discovering new authors and stories.

As a software engineer, I have a strong technical background with experience in various programming languages, frameworks, and tools. I'm always striving to improve my skills and stay up-to-date with the latest trends and best practices. I love working with startups, especially those in the web3 and blockchain space, because I believe that these technologies have the potential to revolutionize the way we live and work.

Overall, I'm a dedicated and driven individual with a wide range of interests and skills. I believe that my passion for software engineering, combined with my love of music and reading, makes me a well-rounded and adaptable professional.

Leave a Reply

Your email address will not be published. Required fields are marked *