Giter Site home page Giter Site logo

dot-net-core-pre-push-checks's Introduction

Dot Net Core Git Pre Push Checks

This is a git pre push script for dot net core to check your push isn't going to break the build and will pass all unit tests.

What to do

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.

All you should need to change is on line 32, "cd test", change this to to the root folder of your test project. e.g. cd test/MyTestProject.

How to run

Everything is automated, and will run on every "git push" command. Git knows to look in the .git/hooks folder and as long as the file is named "pre-push" then all will work.

Fails

If the pre-push fails, then you will get a red terminal message of:

  1. Failed to build the project, please fix this and push again
  2. Unit tests failed, please fix and push again

Pass

If the pre-push all passes, then you will get a green terminal message of:

  1. Pre push check passed!

Your push will also be pushed to your git repo.

Issues

These are some things I have came across while running this pre-push.

  1. If you haven't pulled the most recent changes from your repo, then the pre-push check will run but only at the end of the pre-push you will be told you need to "git pull" the latest changes before you can push.
  2. If you are running your application in visual studio, you will need to stop it running before the pre-push can run.

dot-net-core-pre-push-checks's People

Contributors

nomadster avatar redfern avatar vella-nicholas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.