Skip to content

Instantly share code, notes, and snippets.

@nebil
Last active August 10, 2023 19:42
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nebil/f96a2f0bfe1e059d589d6a2190a2ac81 to your computer and use it in GitHub Desktop.
Save nebil/f96a2f0bfe1e059d589d6a2190a2ac81 to your computer and use it in GitHub Desktop.
🎨 The opinionated Git styleguide — with emoji! 🎨

Git – styleguide

Rationale

A styleguide is about consistency. Consistency with this styleguide is important. [...]
However, know when to be inconsistent -- sometimes the styleguide just doesn’t apply.
When in doubt, use your best judgment. Look at other examples and decide what looks best.

                           PEP 8, the styleguide for Python code

Message

Each commit message uploaded to the repository must...

  • be succinct, but descriptive,
  • be written in English,
  • start with a verb written in the simple past tense,
  • include a summary limited by 72 characters,
  • start with a capital letter, but finish without a period.

Besides, if the summary isn’t enough to explain the commit, you should then include a description.
And adding one is a piece of 🍰.

$ git commit -m "This is a summary" -m "And this is a description."

These are some examples of commit messages that meet the above rules.

Added a command-line option to parse the score rules
Adapted the code to harvest data from multiple sites
Replaced a couple of magic numbers

Emoji

Furthermore, I recommend prepending an emoji to the message. 😀
For future references, I’m maintaining this table with some proposals.

Commit theme Suggested emoji Emoji code
Fix a bug 🐛 :bug:
Refactoring 🎨 :art:
New idea 💡 :bulb:
New feature ⭐ ✨ :star: :sparkles:
New version 🏷️ :label:
New release 🎉 📦 :tada: :package:
New changelog 📰 :newspaper:
Attach a file 📎 :paperclip:
Documentation 📖 📚 :book: :books:
Add a comment 💬 :speech_balloon:
Licensing 📜 ©️ :scroll: :copyright:
Fix a typo 📝 :pencil:
Text changes 🔤 :abc:
Styleguide 👮 🚓 :cop: :police_car:
Adjust a linter 🔍 🔦 :mag: :flashlight:
Better UI 💄 :lipstick:
Better UX 🎀 :ribbon:
Better dryness 🌵 🏜️ :cactus: :desert:
Work in progress 🚧 :construction:
Revert a commit :rewind:
General cleaning 🚿 :shower:
“.(xyz)ignore” file 🙉 :hear_no_evil:
Reorganize files 📁 :file_folder:
Remove some code 🗑️ :wastebasket:
Make a hotfix 🚒 :fire_engine:
Something incipient 🌱 :seedling:
Something dicey ⚠️ 🎲 :warning: :game_die:
General achievement 💪 👌 :muscle: :ok_hand:
Configuration 🔧 :wrench:
Sample data 📋 :clipboard:
Database 🗄️ :file_cabinet:
Testing :white_check_mark:
Logging 📢 :loudspeaker:
Profiling ⏱️ :stopwatch:
Regular expression 🦉 :owl:
Shell scripting 🐚 :shell:
Monkey patching 🐒 :monkey:
Build process 🏗️ :building_construction:
Deployment 🚀 :rocket:
Security 🔒 :lock:
Accessibility :wheelchair:
I18N/L10N 🗺️ :world_map:
Metrics 📊 :bar_chart:
Performance 🐎 :racehorse:
Deprecation 💀 :skull:
Code freeze ❄️ :snowflake:
Breaking changes 🔥 :fire:
Dependency upgrade ⬆️ :arrow_up:
Dependency downgrade ⬇️ :arrow_down:
GNU/Linux 🐧 :penguin:
macOS 🍎 :apple:
FreeBSD 😈 :smiling_imp:
OpenBSD 🐡 :blowfish:
Windows 🏁 :checkered_flag:
Brave 🦁 :lion:
Firefox 🦊 :fox_face:
Docker 🐳 :whale:
C#, F# 🎼 :musical_score:
Crystal 🔮 :crystal_ball:
Dart 🎯 :dart:
Go 🐿️ :chipmunk:
Haskell 🍛 :curry:
Java :coffee:
Lua 🌙 :crescent_moon:
OCaml 🐫 :camel:
Perl 🐪 :dromedary_camel:
Python 🐍 :snake:
Ruby 💎 :gem:
Rust ⚙️ :gear:
Swift 🦅 :eagle:
Cassandra 👁️ :eye:
MongoDB 🍃 :leaves:
MySQL 🐬 :dolphin:
PostgreSQL 🐘 :elephant:

For specific topics of the project, you can keep looking here.

References

How to write a Git commit message — Chris Beams

License

Creative Commons License
This document is licensed under a Creative Commons 4.0 license.

Git – guía de estilo

Esto es un documento de Nebil (del presente), elaborado por Nebil (del pasado), para ayudar a Nebil (del futuro).

Rationale

Espera, ¿realmente debería existir una guía para Git?
                   yo, cuando comencé a escribir esto

No, no es estrictamente necesario. Sin embargo, tu cerebro está acostumbrado a la consistencia.

Mensaje

Cada commit message subido al repositorio debe...

  • ser sucinto, pero descriptivo,
    [Esto es lo más importante, Nebil: una inversión en tu futuro, cuando explores el pasado.]

  • estar escrito en inglés,
    [En tus primeros pasos en la programación, fuiste un férreo opositor al imperialismo anglosajón;
     no obstante, ahora comprendes que esto es, meramente, un asunto de pragmatismo. 😌
     El inglés es la lingua franca del desarrollo de software.]

  • empezar con un verbo escrito en simple past,
    [Existen dos grandes escuelas: en modo imperativo o en tiempo pasado.
     Sin embargo, piensas que suena mejor escribir en pasado —sobre todo, con verbos como fix.]

  • tener un título que no supere los 72 caracteres,
    [Más allá de ese límite, GitHub comienza a cortar el título. Además, por algo es un summary.]

  • llevar una mayúscula inicial, pero sin punto final.
    [Los títulos suelen llevar una mayúscula inicial. Los títulos no suelen terminar con un punto.
     Por favor, respeta la naturaleza de los títulos.]

Además, si el título no alcanza para describir el commit, es posible agregar una descripción, al escribir...

$ git commit -m "This is a summary" -m "And this is a description."

A continuación, mostraré ejemplos de commit messages que satisfacen las reglas anteriormente señaladas.

Added a command-line option to parse the score rules
Adapted the code to harvest data from multiple sites
Replaced a couple of magic numbers

Emoji

Además, es recomendable añadir un emoji al inicio del mensaje. 😀
Para futuras referencias, dejaré una tabla por aquí.

Temática del commit Emoji sugerido Código del emoji
Arreglar bug 🐛 :bug:
Refactoring 🎨 :art:
Nueva idea 💡 :bulb:
Nuevo feature ⭐ ✨ :star: :sparkles:
Nueva versión 🏷️ :label:
Nuevo release 🎉 📦 :tada: :package:
Nuevo changelog 📰 :newspaper:
Adjuntar archivo 📎 :paperclip:
Documentación 📖 📚 :book: :books:
Añadir comentario 💬 :speech_balloon:
Licencias 📜 ©️ :scroll: :copyright:
Arreglar typo 📝 :pencil:
Cambios de texto 🔤 :abc:
Guía de estilos 👮 🚓 :cop: :police_car:
Ajustar linter 🔍 🔦 :mag: :flashlight:
Mejora de UI 💄 :lipstick:
Mejora de UX 🎀 :ribbon:
Mejora de dryness 🌵 🏜️ :cactus: :desert:
Work in progress 🚧 :construction:
Revertir commit :rewind:
Limpieza general 🚿 :shower:
Archivo “.(xyz)ignore” 🙉 :hear_no_evil:
Ordenar archivos 📁 :file_folder:
Eliminar código 🗑️ :wastebasket:
Apagar incendio 🚒 :fire_engine:
Algo incipiente 🌱 :seedling:
Algo riesgoso ⚠️ 🎲 :warning: :game_die:
Logro general 💪 👌 :muscle: :ok_hand:
Configuración 🔧 :wrench:
Datos de muestra 📋 :clipboard:
Base de datos 🗄️ :file_cabinet:
Testing :white_check_mark:
Logging 📢 :loudspeaker:
Profiling ⏱️ :stopwatch:
Expresión regular 🦉 :owl:
Shell scripting 🐚 :shell:
Monkey patching 🐒 :monkey:
Build process 🏗️ :building_construction:
Implantación 🚀 :rocket:
Seguridad 🔒 :lock:
Accesibilidad :wheelchair:
I18N/L10N 🗺️ :world_map:
Métricas 📊 :bar_chart:
Performance 🐎 :racehorse:
Deprecation 💀 :skull:
Code freeze ❄️ :snowflake:
Breaking changes 🔥 :fire:
Dependency upgrade ⬆️ :arrow_up:
Dependency downgrade ⬇️ :arrow_down:
GNU/Linux 🐧 :penguin:
macOS 🍎 :apple:
FreeBSD 😈 :smiling_imp:
OpenBSD 🐡 :blowfish:
Windows 🏁 :checkered_flag:
Brave 🦁 :lion:
Firefox 🦊 :fox_face:
Docker 🐳 :whale:
C#, F# 🎼 :musical_score:
Crystal 🔮 :crystal_ball:
Dart 🎯 :dart:
Go 🐿️ :chipmunk:
Haskell 🍛 :curry:
Java :coffee:
Lua 🌙 :crescent_moon:
OCaml 🐫 :camel:
Perl 🐪 :dromedary_camel:
Python 🐍 :snake:
Ruby 💎 :gem:
Rust ⚙️ :gear:
Swift 🦅 :eagle:
Cassandra 👁️ :eye:
MongoDB 🍃 :leaves:
MySQL 🐬 :dolphin:
PostgreSQL 🐘 :elephant:

Para temáticas específicas del proyecto, puedes seguir buscando acá.

Referencias

How to write a Git commit message — Chris Beams

Licencia

Creative Commons License
Este documento está bajo una licencia Creative Commons 4.0.

Git – guide de style

Rationale

A styleguide is about consistency. Consistency with this styleguide is important. [...]
However, know when to be inconsistent -- sometimes the styleguide just doesn’t apply.
When in doubt, use your best judgment. Look at other examples and decide what looks best.

                           PEP 8, the styleguide for Python code

Message

Chaque message d’instantané (commit) envoyé au dépôt doit...

  • être succinct, mais descriptif,
  • être écrit en anglais,
  • commencer par un verbe conjugué au passé simple (cf. simple past tense),
  • inclure un titre limité par 72 caractères,
  • commencer par une lettre majuscule, mais ne pas se terminer par un point.

Cependant, si le résumé ne suffit pas à expliquer l’instantané, il est recommandé d’inclure une description.
Ceci est simple comme bonjour.

$ git commit -m "This is a summary" -m "And this is a description."

Voici quelques exemples de messages d’instantanés qui respectent les règles ci-dessus.

Added a command-line option to parse the score rules
Adapted the code to harvest data from multiple sites
Replaced a couple of magic numbers

Emoji

De plus, je recommande d’ajouter un emoji au début du message. 😀
Pour des références futures, je maintiendrai cette table avec des propositions.

Sujet de l’instantané Emoji suggéré Code de l’emoji
Corriger un bug 🐛 :bug:
Refactoring 🎨 :art:
Nouvelle idée 💡 :bulb:
Nouvelle fonctionnalité ⭐ ✨ :star: :sparkles:
Nouvelle version 🏷️ :label:
Nouveau release 🎉 📦 :tada: :package:
Nouveau changelog 📰 :newspaper:
Joindre un fichier 📎 :paperclip:
Documentation 📖 📚 :book: :books:
Ajouter un commentaire 💬 :speech_balloon:
Licensing 📜 ©️ :scroll: :copyright:
Fautes de frappe 📝 :pencil:
Changement de texte 🔤 :abc:
Guide de style 👮 🚓 :cop: :police_car:
Régler un linter 🔍 🔦 :mag: :flashlight:
Améliorer l’UI 💄 :lipstick:
Améliorer l’UX 🎀 :ribbon:
Améliorer le dryness 🌵 🏜️ :cactus: :desert:
Work in progress 🚧 :construction:
Revenir en arrière :rewind:
Nettoyage général 🚿 :shower:
Fichier “.(xyz)ignore” 🙉 :hear_no_evil:
Organiser des fichiers 📁 :file_folder:
Supprimer du code 🗑️ :wastebasket:
Faire un hotfix 🚒 :fire_engine:
Quelque chose d’initial 🌱 :seedling:
Quelque chose de risqué ⚠️ 🎲 :warning: :game_die:
Accomplissement général 💪 👌 :muscle: :ok_hand:
Configuration 🔧 :wrench:
Sample data 📋 :clipboard:
Base de données 🗄️ :file_cabinet:
Testing :white_check_mark:
Logging 📢 :loudspeaker:
Profiling ⏱️ :stopwatch:
Expression régulière 🦉 :owl:
Shell scripting 🐚 :shell:
Monkey patching 🐒 :monkey:
Build process 🏗️ :building_construction:
Deployment 🚀 :rocket:
Sécurité 🔒 :lock:
Accessibilité :wheelchair:
I18N/L10N 🗺️ :world_map:
Métriques 📊 :bar_chart:
Performance 🐎 :racehorse:
Dépréciation 💀 :skull:
Code freeze ❄️ :snowflake:
Breaking changes 🔥 :fire:
Dependency upgrade ⬆️ :arrow_up:
Dependency downgrade ⬇️ :arrow_down:
GNU/Linux 🐧 :penguin:
macOS 🍎 :apple:
FreeBSD 😈 :smiling_imp:
OpenBSD 🐡 :blowfish:
Windows 🏁 :checkered_flag:
Brave 🦁 :lion:
Firefox 🦊 :fox_face:
Docker 🐳 :whale:
C#, F# 🎼 :musical_score:
Crystal 🔮 :crystal_ball:
Dart 🎯 :dart:
Go 🐿️ :chipmunk:
Haskell 🍛 :curry:
Java :coffee:
Lua 🌙 :crescent_moon:
OCaml 🐫 :camel:
Perl 🐪 :dromedary_camel:
Python 🐍 :snake:
Ruby 💎 :gem:
Rust ⚙️ :gear:
Swift 🦅 :eagle:
Cassandra 👁️ :eye:
MongoDB 🍃 :leaves:
MySQL 🐬 :dolphin:
PostgreSQL 🐘 :elephant:

Pour des sujets spécifiques au projet, tu peux continuer à chercher ici.

Références

How to write a Git commit message — Chris Beams

Licence

Creative Commons License
Ce document est mis à disposition selon les termes d’une licence Creative Commons 4.0.

@Multikatz
Copy link

¿No hay un estándar para el significado de los emojis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment