You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** Only those options can work that precedes `-m` option in git commit, such as `-p`, `-a`, `-s`, `-v`, `-c` .
58
58
## Guidelines
59
59
### Selecting `type`
60
+
____
60
61
Different types of `type` are there according to make sure one can get idea about the core reason of commit message. Current script supports following types of commits.
61
62
62
63
***feat**: Commits related to a new feature developed
@@ -73,15 +74,47 @@ generation
73
74
***docs**: Commits related to documentation changes, such as Readme.md file
74
75
75
76
### Selecting `scope`
76
-
77
+
____
77
78
The scope in commit message could be anything specifying context of the commit change. A scope context can be a `module`,
78
79
`fileName`, `serviceName`, `directiveName`, `functionName` , `impactArea`, etc.
79
-
80
+
### Selecting `commit-message`
81
+
____
82
+
There are certain rules that everyone should follow to commit like a pro.
83
+
1.[**Limit of 50 characters**](#heading-message-one)
84
+
2.[**Do not end the message with a period**](#heading-message-two)
#### <aname="heading-message-one"></a> 1. Limit of 50 characters
89
+
50 characters is not a hard limit, just a rule of thumb. Keeping message at this length ensures that they are readable, and forces the author to think for a moment about the most concise way to explain what’s going on.
90
+
Even Github truncates any message line longer than 72 characters with an ellipsis.
91
+
> If your message length increases 50 characters even after summarizing, try to adopt atomic commits pattern. You can use `git add -p` to get better insight of changes.
92
+
93
+
#### <aname="heading-message-two"></a> 2. Do not end the message with a period
94
+
Punctuation marks at the end of message is not required as commit messages are considered as subject or titles.
95
+
#### <aname="heading-message-three"></a> 3. Use imperative form
96
+
Imperative form ensures to convey the correct instruction of the commit in short and crisp form. With the current commit semantics, keeping imperative form is much easier.
97
+
Few examples:
98
+
* Pour me a glass of water.
99
+
* Leave the package at the door.
100
+
* Take me to the library.
101
+
102
+
You can read more about imperative form [here](http://www.k12reader.com/learn-about-imperative-sentences-now/).
103
+
#### <aname="heading-message-four"></a> 4. Use present tense
104
+
Usually, we believe commit message records what we have done. But, Git is a distributed version control system where there are potentially many places to get changes from. Rather than writing messages that say what you’ve done; consider these messages as the instructions for what applying the commit will do.
105
+
106
+
For example:
107
+
108
+
`Renamed the variabled for better context` should be `Rename the variabled for better context`
109
+
110
+
Even Git generated commit messages are in present tense. For example:
111
+
112
+
`Merge pull request #1 from akanshgulati/better-desc `
80
113
## Example
81
114
82
115
##### **Command**:
83
-
git refactor header 'change z-index'
116
+
git style header 'move header on top of elements'
84
117
##### **Output**:
85
-
git commit -m "refactor(header): change z-index"
118
+
git commit -m "style(header): move header on top of elements"
0 commit comments