Commitji For Your Git Commits (VSCode edition)

Image for post
Image for post
Sample commits with Commitji

Commitji is a tool to create conventional commits with gitmojis! Using conventional commits allows us to create CHANGELOG or releases in a standard way but with emojis!

In this article, we will discuss on how to use it on VSCode. If you aren’t using VSCode, the CLI is already in WIP. Maybe that will help you 😄

🚀 Get Started

To get started, install the extension from the VSCode marketplace. You can click here to get it.

Once it is installed, you can now see it on your list of extensions.

To verify that it is correctly installed, check it on the command palette by pressing cmd + shift + p and search for “commitji”.

Image for post
Image for post

Once you see that on your command palette, it means it’s installed properly. Time to get started!

👨‍💻 Creating Commitji Message

To create your commit message, execute the command from the command palette, and answer the following prompts.

By default, that workflow that will be used is called Basic Workflow. The Basic Workflow will ask you for the following:

Image for post
Image for post
  • Commit Message — Allows you to explain what did you on your task.
Image for post
Image for post

After providing your commit message, it will now copy the message on your clipboard (so you can command + v) and try to send it to your terminal if there’s an active one. Otherwise, it will prompt you about it and you still have your commit message on the clipboard.

Here’s a sample result from the Basic Workflow:

⚙️ Configuring Commitji

Commitji offers right now some flexibility to support different needs. This will change sooner or later when a lot of people started using it on their workflow too.

If you head on to the settings of your VSCode, you can search for “Commitji” or “commitji” and you will see this.

Image for post
Image for post

The first setting that we will discuss is the selection of workflows. Commitji offers Basic Workflow and Jira Workflow as of the moment.

  • Basic Workflow will ask you what commit type and commit message you want to include. You can see the example above.
  • Jira Workflow will ask you what commit type, Jira Issue Key/Number, Commit Message, and Jira Workflow Transition (optional). This workflow helps you achieve smart commits by Jira.

By default, Commitji uses its preferred commit format

  • Basic Workflow Commit Format: {{unicode}} - {{commitType}}: {{commitMessage}}
  • Jira Workflow Commit Format: {{unicode}} - {{commitType}}: {{issueKey}} {{commitMessage}} {{workflowTransitionName}}

If you wish to modify this, you can change the format of the settings as well. Here are the corresponding key bindings:

  • Unicode: {{unicode}} - This one is for the emoji
  • Commit Type: {{commitType}}
  • Commit Message: {{commitMessage}}
  • Jira Issue Key: {{issueKey}}
  • Jira Workflow Transition Name: {{workflowTransitionName}}

To show an example, let’s use the Basic Workflow and say we want to move our emoji at the end after the commit message. We can do so by doing the following:

Image for post
Image for post

I moved the {{unicode}} binding at the end and the result is this:

You can configure it to anything you want as long as the right bindings are there.

To use the Jira Workflow, make sure it is selected on the workflow selection.

Jira Workflow example without workflow transition:

Image for post
Image for post

Since workflow transition prompt question is optional, you can skip it by pressing esc .

Jira Workflow example with workflow transition:

Image for post
Image for post

If you wish to enable the Jira Workflow Transition, toggle the option Allow Workflow Transition prompt and you must provide an array of workflow transitions in the settings.

For more details about the workflowTransitionName check out this Jira documentation.

🤖 Bringing It All Together

Commitji is actually not just for conventional commits. Commitji can expand to other workflows in the future. This is just the start of it and I’m happy to share it with you. If you have any ideas or you’d like to contribute, provide an issue, or propose feature requests, please do so! I would love that ️❤️ Thank you for reading. Hope this will help you on your journey!

Written by

Improvise, Adapt, Overcome

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store