0

Is there any possibility to enforce all new source code files checked in to a particular repository through Git to have a particular comment, else the push should fail with or without a message. The source code will be of cpp or cxx or cc extensions.

How do we verify commit messages for a push? is about enforcing something in the commit message but I want to enforce something in the source files that are being checked in.

Say for example, If I am writing a GPL library and anyone who commits into the repository should have the GPL license and author name, something like that.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Hari
  • 21
  • 3

1 Answers1

0

Consider to use Git::Hooks, a Perl framework for implementing Git/Gerrit hooks. Here you have all info needed to install/configure it.