bhv
bhv

Reputation: 5378

git unable to commit - error husky > npm run -s commitmsg

I just cloned a project from GitHub and trying to commit changes locally

$ git commit -m 'readme updated'

its showing error

husky > npm run -s commitmsg (node v7.10.0)

enter image description here

even when I tried to commit with vs-code source controller - same error

Upvotes: 2

Views: 5441

Answers (3)

u_pendra
u_pendra

Reputation: 948

For this error I am using

git commit --no-verify -m "your commit message"

Upvotes: 1

SVSchmidt
SVSchmidt

Reputation: 6527

According to the error message, there's a git hook validating the commit messages. They're required to have the specified format (<type>(<scope>): subject).

On https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit examples are given: docs(changelog): update change log to beta.5. In your case, it would be something like docs: update readme or docs(readme): Do stuff.

If you want to contribute to angular, you should stick to this format. If you want to, say, test around for yourself, you might do as suggested: git commit --no-verify.

Upvotes: 3

harshpatel991
harshpatel991

Reputation: 481

As specified by the error message, your commit message needs to follow the format <type>(<scope>): subject

Upvotes: 3

Related Questions