Dot Net Core Git Pre Push Checks

September 19, 2017

If you want to add some security to your pushed to your master branch, you can add in a simple git “pre-push” hook to your /.git/hooks/ directory, then this bash script will be run on every “git push” to the master branch only.

Visit my github repo @ and download the pre-push file.

You need to place this is your git repo folder in /.git/hooks/, this is a hidden folder so you will have to turn on “show hidden folders” or cd into the dir in terminal. E.g. cd /.git/hooks inside of your local repo folder.

You will only need to change one line in the pre-push file, this is on line 28, “cd test”, change this to to the root folder of your test project. e.g. cd test/MyTestProject.

Source code

You Might Also Like

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.