{"id":23274166,"url":"https://github.com/buzut/git-emojis-hook","last_synced_at":"2025-07-03T19:35:26.090Z","repository":{"id":48641933,"uuid":"152330353","full_name":"Buzut/git-emojis-hook","owner":"Buzut","description":"Simple git hook to provide strong guidelines for commit message with emojis","archived":false,"fork":false,"pushed_at":"2021-07-16T08:45:34.000Z","size":12,"stargazers_count":51,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-06T20:08:26.372Z","etag":null,"topics":["git-commit","git-emojis","git-hook","git-workflow"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Buzut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-09T22:33:30.000Z","updated_at":"2023-04-11T19:11:05.000Z","dependencies_parsed_at":"2022-08-30T00:01:24.230Z","dependency_job_id":null,"html_url":"https://github.com/Buzut/git-emojis-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buzut%2Fgit-emojis-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buzut%2Fgit-emojis-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buzut%2Fgit-emojis-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Buzut%2Fgit-emojis-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Buzut","download_url":"https://codeload.github.com/Buzut/git-emojis-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230494926,"owners_count":18235047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git-commit","git-emojis","git-hook","git-workflow"],"created_at":"2024-12-19T20:12:24.420Z","updated_at":"2024-12-19T20:12:25.119Z","avatar_url":"https://github.com/Buzut.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git emojis hook\n\nA simple git hook to provide strong guidelines for commit message with emojis.\n\nThe commit message rules are the ones from Angular. I just augmented them by substituting their textual types with emojis. So it should look like this:\n\n```\n🚑 (authentication): remove buggy function that allowed to login w/o passwd\n```\n\nYou'll notice another slight change from Angular's rules: I added a space between type and (scope). It is indeed visually more pleasant after the emojis.\n\n__Emojis are actual unicode emojis and not markdown emojis like `:fire:`. So it will work virtually everywhere as long as unicode is supported.__\n\nThere are two hooks, one that makes the actual substitution and another one that prints the git commit message helper in the editor.\n\n## Syntax\nHere are the types, their respective codes and the corresponding emojis:\n* __revert__: `:revert:` • ⏳\n* __build__: `:build:` • 📦\n* __ci__: `:ci:` • 🤖\n* __docs__: `:docs:` • 📖\n* __feat__: `:feat:` • 🌟\n* __fix__: `:fix:` • 🚑\n* __perf__: `:perf:` • ⚡\n* __refactor__: `:refactor:` • 🚧\n* __style__: `:style:` • 💄\n* __test__: `:test:` • ✅\n\nIn addition to these, I added `:tada:` 🎉 that's often used for the first commit!\n\n\n## How to use\nFor each project, add the two files in in the `.git/hooks` directory.\n\nAt the root of your git project, this one-liner can set up it all:\n\n```\ncd .git/hooks/ \u0026\u0026 curl -O https://raw.githubusercontent.com/Buzut/git-emojis-hook/master/commit-msg \u0026\u0026 curl -O https://raw.githubusercontent.com/Buzut/git-emojis-hook/master/prepare-commit-msg \u0026\u0026 chmod +x * || exit 0\n```\n\nAlso, it might be handy to place the two files in a directory within your home and add a bash alias to automate the deploy.\n\nFor exemple, in your home diretory, you could organize things like this:\n```\n.gitemojis/\n    commit-msg\n    prepare-commit-msg\n```\n\nAnd in your `.bash_profile` or `.bashrc`\n```\nalias emogitify='cp ~/.gitemojis/* .git/hooks/'\n```\n\nNow, when in a project directory, `emogitify` will add the git-emojis' hooks.\n\n### Integrate to your projects\nUnfortunately, hooks aren't part of a project and therefore, they cannot be commited with the project's files. Nevertheless, you can include the one-liner introduced above into your project's init script. For instance, with JavaScript's npm package manager you could do it like so:\n\n```\n{\n  \"name\": \"project-name\",\n  \"version\": \"1.0.0\",\n  \"description\": \"The next big thing\",\n  \"scripts\": {\n    \"prepare\": \"test -d .git \u0026\u0026 cd .git/hooks/ \u0026\u0026 curl -O https://raw.githubusercontent.com/Buzut/git-emojis-hook/master/commit-msg \u0026\u0026 curl -O https://raw.githubusercontent.com/Buzut/git-emojis-hook/master/prepare-commit-msg \u0026\u0026 chmod +x *\"\n  },\n  \"dependencies\": {…},\n  \"devDependencies\": {…}\n}\n```\n\n`prepare` will then trigger on `npm install` and if there is a `.git` directory and the hooks will be installed automatically.\n\n## Based on Angular's commit message guidelines\nAngular enforces succint and yet very clear guidelines for their commit messages. Let's have a look at the rules. The following is directly copied from [their repo](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines).\n\nWe have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.\n\n### Commit Message Format\nEach commit message consists of a **header**, a **body** and a **footer**.  The header has a special\nformat that includes a **type**, a **scope** and a **subject**:\n\n```\n\u003ctype\u003e(\u003cscope\u003e): \u003csubject\u003e\n\u003cBLANK LINE\u003e\n\u003cbody\u003e\n\u003cBLANK LINE\u003e\n\u003cfooter\u003e\n```\n\nThe **header** is mandatory and the **scope** of the header is optional.\n\nAny line of the commit message cannot be longer 100 characters! This allows the message to be easier\nto read on GitHub as well as in various git tools.\n\nThe footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.\n\nSamples: (even more [samples](https://github.com/angular/angular/commits/master))\n\n```\ndocs(changelog): update changelog to beta.5\n```\n```\nfix(release): need to depend on latest rxjs and zone.js\n\nThe version in our package.json gets copied to the one we publish, and users need the latest of these.\n```\n\n### Revert\nIf the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit \u003chash\u003e.`, where the hash is the SHA of the commit being reverted.\n\n### Type\nMust be one of the following:\n\n* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\n* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\n* **docs**: Documentation only changes\n* **feat**: A new feature\n* **fix**: A bug fix\n* **perf**: A code change that improves performance\n* **refactor**: A code change that neither fixes a bug nor adds a feature\n* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\n* **test**: Adding missing tests or correcting existing tests\n\n### Scope\nThe scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzut%2Fgit-emojis-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuzut%2Fgit-emojis-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuzut%2Fgit-emojis-hook/lists"}