Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does github support precommithooks?

Currently we are using SVN. I would like to start using GitHub, but one absolute requirement is that we will need to have precommit (premerge) validation of the code like we currently have. Does GitHub support precommithooks (premergehooks)?

We're a team of 5 developers. We made an agreement that all code (JavaScript) should pass JSLint-like validation. Voluntary validation has proven not to work because it's easily forgotten. How can we be sure that code that becomes available to the others is guaranteed to validate against JSLint (or similar)?

like image 705
Corno Avatar asked Dec 16 '11 03:12

Corno


People also ask

What are pre-commit hooks GitHub?

The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to be committed, to see if you've forgotten something, to make sure tests run, or to examine whatever you need to inspect in the code.

Can you commit pre-commit hooks?

pre-commit hooks are a mechanism of the version control system git. They let you execute code right before the commit. Confusingly, there is also a Python package called pre-commit which allows you to create and use pre-commit hooks with a way simpler interface.

How do I enable pre-commit hook?

Open a terminal window by using option + T in GitKraken Client. Once the terminal windows is open, change directory to . git/hooks . Then use the command chmod +x pre-commit to make the pre-commit file executable.

Does GitHub support server side hooks?

You can install server-side hooks from your Git repository's Settings sub-tab and then opening the Server-Side Hooks page from the left side of the screen. We already have some hooks that you can install and view their code sources as well.


1 Answers

The concept I was looking for was the prereceive hook

like image 144
Corno Avatar answered Oct 30 '22 22:10

Corno