Introduction

In order to work efficiently in a corporate environment, there are certain prerequisites, or rules, regarding any code that is produced. It should be able to compile and pass specific sets of unit tests. There should also be certain documentation in the commit messages, such as references to a bug fix ID or an instance. Most of these rules can be automated using scripts. But why not put these rules into the process? In this chapter, you will see some examples of how to transfer data from one location to a commit message before you see the message. You will also learn how you can verify whether you are pushing your code to the right location. Finally, you will see how you can add scripts to Git.

A hook in Git is a script that ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.