LinuxCommandLibrary

gitmoji

Use emojis in Git commit messages

TLDR

Start the commit wizard

$ gitmoji --commit
copy

Initialize the Git hook (so gitmoji will be run every time git commit is run)
$ gitmoji --init
copy

Remove the Git hook
$ gitmoji --remove
copy

List all available emojis and their descriptions
$ gitmoji --list
copy

Search emoji list for a list of keywords
$ gitmoji --search [keyword1] [keyword2]
copy

Update cached list of emojis from main repository
$ gitmoji --update
copy

Configure global preferences
$ gitmoji --config
copy

SYNOPSIS

gitmoji [options] [command]

PARAMETERS

init
    Initializes gitmoji support in a Git repository, typically setting up a prepare-commit-msg hook.

config
    Configures gitmoji behavior, such as enabling/disabling automatic emoji appending or specifying custom emoji lists.

add
    Adds a custom gitmoji to the local configuration.

remove
    Removes a custom gitmoji from the local configuration.

commit
    Initiates an interactive commit process, prompting for an emoji and message.

search <term>
    Searches for gitmojis matching the provided term.

list
    Displays a comprehensive list of all available gitmojis with their codes and descriptions.

update
    Updates the local gitmoji list to the latest version from the source.

--version
    Displays the current version of the gitmoji CLI.

--help
    Shows the help message for the command or a specific subcommand.

DESCRIPTION

gitmoji is a command-line interface tool designed to streamline the process of adding emojis to Git commit messages, adhering to the "gitmoji" specification. This specification suggests using specific emojis to categorize and visually enhance commit messages, making the commit history more readable and understandable at a glance.

The gitmoji CLI typically offers an interactive mode that prompts the user to select an emoji from a predefined list and then guides them through adding the commit message (subject and body). It aims to standardize commit conventions across teams and projects, improving collaboration and code review processes. Beyond interactive committing, gitmoji often provides functionalities to list available emojis, search for specific ones, initialize emoji support in a Git repository, and update the emoji list. It integrates seamlessly with Git workflows, often leveraging Git hooks (like prepare-commit-msg) to automate the emoji selection and message formatting, ensuring consistency without manual intervention.

CAVEATS

gitmoji is an external tool and not part of the standard Git distribution. Its availability depends on separate installation.

The effectiveness and adoption of gitmoji conventions depend on team agreement and consistency.

The list of emojis and their descriptions might vary slightly between different gitmoji CLI implementations or versions.

Using emojis in commit messages might not be universally supported by all Git clients or web interfaces, though most modern ones handle them well.

CUSTOMIZATION

Users can often customize the behavior of gitmoji tools, such as disabling automatic emoji prepending, adding custom emojis, or modifying the default commit message format through configuration files, typically located in the user's home directory or within the Git repository's .git/config or a project-specific configuration file.

INTEGRATION WITH GIT HOOKS

The most common way gitmoji ensures consistent emoji usage is by setting up a prepare-commit-msg Git hook. This hook is executed after the commit message is created but before the editor is launched, allowing gitmoji to prompt for an emoji and prepend it to the message, thus automating adherence to the convention.

HISTORY

The concept of "gitmoji" for commit messages gained popularity around 2017-2018, primarily championed by the carloscuesta/gitmoji repository, which provides the specification and a comprehensive list of emojis. Following this, various CLI tools emerged to automate the process, with carloscuesta/gitmoji-cli being one of the most prominent implementations, developed to make it easier for developers to adopt and maintain the gitmoji convention in their daily Git workflows. Its development has focused on providing an interactive, user-friendly experience to standardize commit practices.

SEE ALSO

git(1), git-commit(1), git-config(1), git-hook(5)

Copied to clipboard