How to use Git Hooks

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 65

  • @KieCodes
    @KieCodes  4 роки тому +5

    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!

  • @Manapoker1
    @Manapoker1 4 роки тому +2

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

    • @KieCodes
      @KieCodes  4 роки тому

      Thanks a lot. It was really fun to make. I am glad you enjoyed it.

  • @Bigsby_
    @Bigsby_ 4 роки тому +4

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

    • @KieCodes
      @KieCodes  4 роки тому +1

      Wow! That are really kind words! Thank you. ☺️☺️

  • @rafael86ny
    @rafael86ny 2 роки тому +1

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

    • @KieCodes
      @KieCodes  2 роки тому

      You are more than welcome my friend. 🙏 Rock on! 🚀

  • @diegorocha2186
    @diegorocha2186 3 роки тому +2

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

    • @KieCodes
      @KieCodes  3 роки тому

      I am sorry. I am still learning and trying to get better in front of the camera.

  • @omardixanpuigpupo5028
    @omardixanpuigpupo5028 2 роки тому +1

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

    • @KieCodes
      @KieCodes  2 роки тому

      You are more than welcome my friend. 🙏 Rock on! 🚀

  • @bharathkumar2007
    @bharathkumar2007 3 роки тому +1

    Thats cool playing with hooks and lights :)

  • @RyanKane
    @RyanKane 4 роки тому +1

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

    • @KieCodes
      @KieCodes  4 роки тому

      Thank you Ryan. I am glad you found some value. 😅

    • @KieCodes
      @KieCodes  4 роки тому +1

      Hey again Ryan! I saw and approved your pull request. That’s amazing. Thanks for adding support for windows users. I really appreciate that!

  • @moo_goo
    @moo_goo 3 роки тому +1

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

  • @chikosan99
    @chikosan99 3 роки тому +1

    Crazy and beautiful (:
    Thanks 💥

    • @KieCodes
      @KieCodes  3 роки тому

      You are more than welcome my friend. 🙏 Rock on! 🚀

  • @magneat
    @magneat 3 роки тому +1

    straight away like just for the music intro =)

    • @KieCodes
      @KieCodes  3 роки тому

      Haha. Thank you. 😅

  • @jonasbritto
    @jonasbritto 2 роки тому +3

    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?

    • @KieCodes
      @KieCodes  2 роки тому

      I have never done that but I would think that you can use the commit-msg to reformat the file in which the commit message is stored. So after reading and validating the commit message, you can search for your RAT-123 and replace it with your url. Then safe the new commit message back to the temporary file the commit messages came from.
      I hope that helps! Cheers!

  • @coledrain2158
    @coledrain2158 2 роки тому +1

    Still facts in 2022
    Thanks alot

  • @kajalkumari-xj6ou
    @kajalkumari-xj6ou 4 роки тому +2

    Great video :)

  • @DevOpsDirective
    @DevOpsDirective 4 роки тому +2

    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...

    • @KieCodes
      @KieCodes  4 роки тому

      😂 Ohh you did watch it with a lot of attention. Thank you! 🙃 And yes. I sneakingly cut that out. It was my first attempt to just record myself while coding and trying to make something out of it that's at least watchable. 😅I left two hiccups in there but I wouldn't want to drag this video even longer and destroy the flow of the video even more by this stupid missing "R".

  • @vacagonzalo
    @vacagonzalo 2 роки тому +1

    Thanks!

    • @KieCodes
      @KieCodes  2 роки тому

      You are more than welcome.

  • @prasadgattu4550
    @prasadgattu4550 3 роки тому

    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?

  • @hamzasabri5610
    @hamzasabri5610 2 роки тому +1

    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.

    • @KieCodes
      @KieCodes  2 роки тому

      Thank you for your feedback. 🙏

  • @monsterthrash
    @monsterthrash 4 роки тому +1

    Ok, this is awesome.

    • @KieCodes
      @KieCodes  4 роки тому +1

      Thanks!!! It is a powerful concept to make your life easier and improve your commits.

  • @mikesmith853
    @mikesmith853 4 роки тому +1

    SOLID stuff! :)

    • @KieCodes
      @KieCodes  4 роки тому

      Thanks Mike! Glad you found some value!

  • @MrMashyker
    @MrMashyker 4 роки тому +1

    Thank you!

    • @KieCodes
      @KieCodes  4 роки тому

      You are more than welcome!

  • @aaronbaron6468
    @aaronbaron6468 2 роки тому +1

    this remined me why the FLESH IS WEAK!

  • @bharatkijai8949
    @bharatkijai8949 4 роки тому +1

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

    • @KieCodes
      @KieCodes  4 роки тому

      Thabks mate. I will put it on my topic list. Cheers

    • @bharatkijai8949
      @bharatkijai8949 4 роки тому

      @@KieCodes could you reply here for now because making videos takes time , I have to complete some task in office asap .
      My question:
      Where to check-in server side hooks , if you are telling .git/hooks then this is not feasible as it willl be present at client side

    • @bharatkijai8949
      @bharatkijai8949 4 роки тому

      I have addit client hooks pre commit and commit message , now I need to add server side hooks

    • @KieCodes
      @KieCodes  4 роки тому

      Sure. You can't check server side hooks into your repository. Server-side hooks are meant to be installed by the server administrator directly on the server. On your git server there should be also a .git/hooks directory where you can place the server side hook scripts.
      If you are not hosting your own git server, you need to talk to your hoster how to access that folder or if you use something like github, gitlab or bitbucket, there might be some api you can use to react to certain git events.

    • @bharatkijai8949
      @bharatkijai8949 4 роки тому

      @@KieCodes we are using github , which is not hosted by us , so does it mean we cannot access .git ?

  • @sinamobasheri
    @sinamobasheri 3 місяці тому

    01:30 "Git is a file base system" move on to next video..., although thank for time and effort ❤

    • @KieCodes
      @KieCodes  18 днів тому

      Git is a file based system. You are welcome.

    • @sinamobasheri
      @sinamobasheri 18 днів тому +1

      @KieCodes My friend, I'm not looking to argue over the internet! But Git isn't a "File-Based System"!
      Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it. [Pro Git, Git Internals Chapter]
      Saying that Git is a "File-Based System" implies that the fundamental unit in Git is a file, but it isn't!
      People make this mistake often enough now. This kind of thinking about Git leads to problems they can't solve when the time comes!

    • @KieCodes
      @KieCodes  18 днів тому +1

      @sinamobasheri thanks for clarifying. I should have said that the data for the local git repo is contained in the .git subfolder.

  • @Ojee2
    @Ojee2 3 роки тому +1

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

    • @KieCodes
      @KieCodes  3 роки тому

      Yeah. It was one of my first videos. Sorry for that.

  • @greob
    @greob 4 роки тому +1

    Pretty good demonstration, thank you. Nice editing!

    • @KieCodes
      @KieCodes  4 роки тому

      Thanks to you for being so active here! I really appreciate this.