gitconventional-commits

what is the difference between a simple commit and conventional commit


I'm new with the git and i'm working on my own project and what i do every time is

git add .

then

git commit -m "message "

with a message and then i push but recently i learnt about commit conventional but i didn't understand what is the difference about them ? can u explain it to me I mean i search for method that allows my friend to be updated and understand what i do on my project thanks on advance


Solution

  • Conventional Commits is purely a convention of how to structure the commit message.

    It's probably not hugely important if it's just you and a few friends (at least not more important than the actual message text), but in bigger projects and projects with lots of public interest and/or automated tools working on them it's a unified way to structure frequently-provided information.

    For example if your commit message would usually be something like

    Add option to frobnicate the quux.
    

    Then the "equivalent" commit message written to the rules of a Conventional Commits would look something like this:

    feat(quux): Add option to frobnicate the quux.
    
    Refs: FOO-123
    

    (Where FOO-123 would be a reference to some ticketing system).

    As you see it's not fundamentally different, it just provides a fixed structure and some conventions.

    In my opinion as long as you don't strictly use tickets (bugs/issues/...) to track all your work, you're probably not at a level where you need to care about this.