How to use Git Hooks

preview_player
Показать описание
Git hooks are a great way to automate your quality assurance for your commits. In this tutorial, we will explore the different types of git hooks (pre-commit, prepare-commit-message, commit-msg, post-commit to name just a few) and how to use them. In the demo at the end, we will write our very own commit message git hook to automatically check for a high-quality commit message.

The code written in this video can be found here:

Questions of the day
■ Do you use git hooks?
■ What are creative usages for git hooks you can think of?

Mentioned:

Further reading:

Timestamps:
00:00 Intro
01:12 What are git hooks?
02:23 Side note: Webhooks
03:13 pre-commit hook
03:50 prepare-commit-msg hook
04:37 commit-msg hook
05:54 post-checkout and post-merge hooks
06:29 How to share your git hooks with your team?
08:16 Implementing commit message check git hook
17:00 Implementing a git hook to control your hue lights

---

This video contains advertising content.

---

Attribution:

#git #softwaredeveloper
Рекомендации по теме
Комментарии
Автор

This video is about Git again and is a follow up to my last video on GIT HYGIENE.

A good way to make sure you are following your own rules (or help teammates to follow your rules) is to put some automatic checks in place.

In this video, we'll discover the concept of git hooks and see how they can help us to do exactly that. And in the end, we will write our own git commit checker.

Happy learning!

KieCodes
Автор

Thank you. I have learned more with this video than any other resource online.

rafaelny
Автор

WOW
!
i'm really impressed! Your idea of switching the colors of the light was really funny :D

Manapoker
Автор

Great video, useful tips and production value through the roof!

Bigsby_
Автор

Great content! But all these videos cuts increased my anxiety level by tons :X hahahah

diegorocha
Автор

Just started looking into hooks recently. This is a nice jump-start!

RyanKane
Автор

Great! I had been searching for it, thanks for take your time.

omardixanpuigpupo
Автор

great video! also.. totally trying the phue module.. thats awesome

moo_goo
Автор

Thank you.. Killer editing n video

I wanted to do 1 more thing besides validation

That is convert the commit msg content itself.. basically if commit msg has RAT-123 then convert that to a URL with 123 as the parameter in the URL

What technique you would recommend?

jonasbritto
Автор

Very useful! -- but don't think we didn't catch you sneakily modifying line.stip() to line.strip() at 16:34. I was on the edge of my seat waiting for you to hit that else branch...

DevOpsDirective
Автор

Thank you so much for the amazing video!

One small note, the naming was confusing at first it was hard to keep track in wich directory you are in because the project name was git-hooks and then you cd to ./git/hooks. Other than that it is amazing.

hamzasabri
Автор

Thats cool playing with hooks and lights :)

bharathkumar
Автор

straight away like just for the music intro =)

magneat
Автор

Good Video. I have a question. When someone commits the changes to the Jenkinsfile, I want to perform SAST scan on that Jenkinsfile. I have a pipeline for this in the Jenkins. How to achieve this with the git hooks?

prasadgattu
Автор

this remined me why the FLESH IS WEAK!

aaronbaron
Автор

Hi, where to put server side git hooks ? Could you please reply and make a video asap

bharatkijai
Автор

I tried to watch but the 1000x cuts are just to much. Content is great tho but it's just not watchable.

Ojee
Автор

Pretty good demonstration, thank you. Nice editing!

greob