xkcd on git commit messages
The ability to write consistent git commit messages is a skill that will serve both you and any team youβre working...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for letting me know about this. I use git here and there and like the feature of template.
git config --global core.editor=nvim +14 -c 'startinsert' didn't work for me
I use arch, not sure if that's the reason, but for anyone having trouble with this.
My fix
git config --global core.editor 'vim +14 +startinsert'
cheers
Thanks for pointing this out, @haxnet . I've edited the article to include Neovim and Vim configurations, with links to more info!
Conventional Commits node package also does this for you but gives you a nice interactive cli asking you to choose / enter descriptions etc.
Thanks for this! It seems really slick. For anyone else interested, the project is called commitlint.
Can I suggest updating your example to match the style that is actually recommended on Conventional Commits site which you linked to.
Remove the brackets. Brackets are for scope.
Based on the link, if you were working on adding a language to the docs, you could add scope.
I think the scope is also useful for module. For example if you have
foo
andbar
insrc
directory, you would dofeat(foo)
to show the commits are scoped to thefoo
module.The scope can be whatever you want but the advice is your team needs to agree on it and stick to it.
Thanks for mentioning this. When I originally started using the convention, I didn't use the scope/module designator, since for many smaller projects it can be overkill. I just kept the parentheses around the type for aesthetics, but I see how that could be confusing for someone adopting the conventional method (and/or make the template incompatible with other conventional commit tools). I've updated the article to include these changes, and also added more info on structuring a commit message in my git configuration.
Cheers!
That linked page looks good.
That's a lot of dotfiles. Here are just a few of mine github.com/MichaelCurrin/dotfiles
Happy to help :)
Also you could turn your help message into a shell alias or a bookmarked page / gist so you can read it anytime without committing.
Something useful to add to your available type is
chore
. Such as deleting or renaming a file. Or changing a config like.gitignore
which relates more to the repo itself than your application's build flow.I started using
build
for only build-related configs - like apackage.json
or lint config file.I actually had already been using
chore
, but forgot to add it here! The article's been updated to include it. Thanks for mentioning it!You're welcome.
I'd appreciate if you have a look at my extension which doesn't let you choose a semantic message, it writes one for you.
github.com/MichaelCurrin/auto-comm...
There is also a nice vscode extension for conventional commits
Nice, thanks for sharing!
Just a minor typo: the git-config to set line 14 on vim should say
core.editor
instead ofcore-editor
.Thanks for catching that! Itβs been edited and updated. Cheers!
Thank you for sharing
Thanks, really useful.
You may want to add that the comment character is configurable. In my case is ; so I modified the template accordingly.
Thanks! I've edited to include info on configuring the comment character. From git's documentation, both the
#
and;
characters are valid by default, but in case anyone wants theirs to be "π€«" or something, there is info on how to set it now!This is great π. I was thinking if i was able to do such a think. It is very useful for dev teams working with git - issues - branches.
Thanks for sharing Timothy.
I like the idea of creating a commit message template :). Might end up proposing this to the teams at my company!