Complete guide to GitHooks - Creating your own pre-commit hooks

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 23

  • @mistymu8154
    @mistymu8154 Год назад +19

    Great video. Just a quick aside, by default, VS Code hides the .git folder so needed to add the following to my settings:
    "files.exclude": {
    "**/.git": false
    }

  • @jaysharma3504
    @jaysharma3504 Год назад +2

    Great video dude! Do post on pre-commit framework when you can. Looking forward to it!

    • @GitGuardian
      @GitGuardian  9 месяцев назад

      Working on the new video now!

  • @MrUmban
    @MrUmban 10 месяцев назад

    Amazing explanation. Thank you!

  • @bactran7799
    @bactran7799 Год назад +1

    your video is really valuable to me. Thanks a lot

  • @mirosawkodzinski9779
    @mirosawkodzinski9779 Год назад +1

    Great tutorial., explains a lot.

  • @test-em3re
    @test-em3re 7 месяцев назад

    will this work on GitHub desktop ?

  • @sanjayaelvitigala3086
    @sanjayaelvitigala3086 Год назад +1

    nicely explained.

  • @clusterdriven
    @clusterdriven Год назад +1

    Great video. Thank you for this. Me personally, I prefer the approach of creating a wrapper for git, so that i can say:
    commit "message here"
    and it automatically adds everything + does any other checks such as linting or tests before commits. This also provides the benefit of a syntax that fits your needs. But thank you for the content

    • @GitGuardian
      @GitGuardian  Год назад

      Another good option, perhaps a little more advanced than a git hook. Maybe worth a vedio on this method

    • @clusterdriven
      @clusterdriven Год назад

      @@GitGuardian Right. It does not need to be super advanced. In my case, for example, I simply add this to my .bashrc:
      # Automatically stage all, commit, and push in one command
      function commit() {
      if [ -z "$1" ]; then
      echo "Please provide a commit message."
      return 1
      fi
      git add .
      git commit -m "$1"
      push
      }
      the above automatically adds all changes to staging, commits with a given message, and pushes. Of course you can customize it to your needs. But the above is a simple bash function.

    • @clusterdriven
      @clusterdriven Год назад

      the "push" is because I also have the following alias:
      # Using push will resolve to git push origin $(current_branch)
      function push() {
      git push origin $(git symbolic-ref --short HEAD)
      }

  • @eswarm1234
    @eswarm1234 9 месяцев назад

    Please do a video on pre-commit framework

    • @GitGuardian
      @GitGuardian  9 месяцев назад

      Sure thing @eswarm1234

  • @raypenha2572
    @raypenha2572 Год назад

    Congratulations for the vídeo

  • @kamyarghanbarpour764
    @kamyarghanbarpour764 6 месяцев назад +1

    Thanks a lot

  • @larsvagt1340
    @larsvagt1340 8 месяцев назад

    Basically cool explanation. Unfortunately I cannot give to my dev team due to the joke. One of the devs is a dad who experience a similar thing at school and it would really hurt him. :(

  • @robQW5UgexX
    @robQW5UgexX 9 месяцев назад

    thanks!

  • @anshuldishoriya2992
    @anshuldishoriya2992 8 месяцев назад +1

    nicely explained.