Anil Shivaraj
Anil Shivaraj

Reputation: 111

Make github commit messages mandatory

Is there way i can make commit messages mandatory? I need this validation both from UI and API level so i dont see any commits that have blank description.

Is that possible?enter image description here

Upvotes: 0

Views: 930

Answers (2)

Adil B
Adil B

Reputation: 16806

Github Enterprise has this feature available as a pre-receive hook.

Examples of pre-receive hooks from the readme:

  • Require commit messages to follow a specific pattern or format, such as including a valid ticket number or being over a certain length.
  • Prevent sensitive data from being added to the repository by blocking keywords, patterns or filetypes.
  • Prevent a PR author from merging their own changes.
  • Prevent a developer from pushing commits of a different author or committer.
  • Prevent a developer from pushing unsigned commits.

Upvotes: 1

Andrew Lau
Andrew Lau

Reputation: 145

I do not think that is possible. The UI always sets a default commit message if you do not specify one on your own. The extended description section, however, is optional and is probably specific to GitHub.

Upvotes: 0

Related Questions