Hello, there 👋🏼 I hope you are doing well.
As a developer, I know you are well aware of the Git version control system.
Just wanted to know:
How do you write your ▶
git commit -m "commit message"
Do you follow any special rule or something?
Let's discuss in the comment section below 😄
Oldest comments (19)
Describe what I will push... What to say... 😄
I recently started using emojis in my commits, they really look good, this is an example:
✨feature(scope): a short description of the feature
But, I really want to see other good ideas for commits
I also ❤ emojis
My format is:
git commit -m "$SUPPORTING_EMOJI:$TYPE_OF_COMMIT: $COMMIT_DESCRIPTION"[PROJECT-TICKET] Tasks completed in present tense
I either use the conventional commits specification or just type what describes the commit best.
This is nice 👌🏻
I have a template for Git commit in work which mentions the pattern of issue ID then it can be checking crossly with issues management tool by just a click, but just use the simple message for my personal stuffs.
What template are you talking about and how do you implement/incorporate that template when committing the code?
thoughtbot.com/blog/better-commit-... here is a tutorial. My template is just put the prefix string like
ABC-, then whenever I commit code, I just put the number sequentially defined prefix and also commit message at the end.Git commit template is also affected to Git-familiar-tools like VScode/Fork.
A while back I adopted this format for an angular project, which is basically the Angular commit format It became muscle memory and has essentially become my standard.
a couple of things:
there is a sparrow plugin which makes it possible to reject commits with syntax errors in commit messages - sparrowhub.io/plugin/git-commit/0....
in combination with "git-commit" plugin you can use "git-current-branch" plugin to inject a branch name into every commit message - sparrowhub.io/plugin/git-current-b...
The whole flow is available through the Tomtit task runner - github.com/melezhik/Tomtit#profiles
Or
Start with a verb in the imperative/present tense. Follow with a short sentence describing the task that just occurred - no period at end.
Might also use Gitmoji
There are rules how to write them correctly by design of git, they are probably invented by Linus Torvalds author of git.
The message should look like this:
also the first sentence should be shorter (not sure exactly how many characters).
I'm trying to write commit message like this if there are reason why something was changed. This is important specially with big projects and lot of changes where you don't know other part of the code. The message should be the clue.