Skip to content

A Git hook that will prevent commiting code that contains a //NOCOMMIT: line

License

Notifications You must be signed in to change notification settings

bikerdan/NoCommitGitHook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NoCommitGitHook

This is a git hook that will prevent commits if it finds //NOCOMMIT: anywhere in the staged code.

========================================================

Example:

  

When you try to commit this file, the commit will fail and show you the message "Don't commit this debug!!!"

========================================================

Installation:

To install this hook, copy the pre-commit file into your git templates/hooks directory. On windows this is probably in "C:\Program Files (x86)\Git\share\git-core\templates\hooks".

Any new repositories will have use this hook. To have this work on existing repositories you will need to run "git init" in the repository directory. If you already have a pre-commit hook installed in that repo, it will not add it. You will need to add it yourself

About

A Git hook that will prevent commiting code that contains a //NOCOMMIT: line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published