Git hooks, practical uses (yes, even on Windows)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 เม.ย. 2018
  • Git hooks: What are they? What do they do for you? Dive right in with this relaxing overview and practical demonstration of the power of Git hooks! (For an outline click "SHOW MORE")
    What are Git hooks?
    Git hooks allow you to run your own scripts whenever important events occur in the Git life-cycle, like committing, merging, and pushing. That means the only limit to Git hooks is your imagination (and the patience of your coworkers).
    Index of contents
    * 00:07: Overview of Git hooks
    * 00:46: The "nitty gritty" of git hooks
    * 01:18: Default sample hooks
    * 01:41: Location of Git's repo template
    * 02:08: Pre vs Post hooks
    * 02:52: zero == hero
    * 03:36: Local vs server side hooks
    * 03:49: Enabling a hook
    * 04:22: Gotchas (pitfalls)
    - 04:24: Surprises!
    - 04:45: Hooks not source controlled
    - 05:42: bypass a hook with --no-verify
    - 05:59: silent failure mode
    * 06:20: Getting practical with git hooks
    * 06:27: Verify name/email with pre-commit hook
    * 07:57: Ensure no words match a "blacklist"
    * 08:16: Live demo of name/email pre-commit hook
    * 09:43: pre-commit vs pre-push hooks
    * 10:32: Your choice of scripting language (#! shebang!)
    * 11:11: Get hooks working on Windows
    * 12:16: Set hooks dir with core.hookspath
    Learn more and join the git hooks conversation at tygertec.com/git-hooks-practi...
    * Twitter: / tygertec
    * Site: tygertec.com
    Thanks for watching. Subscribe now and enjoy relaxing tech tutorials.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 28

  • @mahipalsingh9361
    @mahipalsingh9361 2 ปีที่แล้ว +1

    I was watching this video on a chrome profile without gmail login and this video helped me so I logged and liked this video and subscribed

  • @superus8r
    @superus8r 5 ปีที่แล้ว +7

    Thank you so much for a clear explanation and great visualization of the topic. :)

  • @patriciusx
    @patriciusx 5 ปีที่แล้ว +1

    Very cool walk through. thank you!

  • @cruepprich
    @cruepprich 2 ปีที่แล้ว

    Very good explanation. Keep 'em coming!

  • @ManashMandalKumar
    @ManashMandalKumar 4 ปีที่แล้ว +2

    To the point, much appreciated :)

  • @aaronaaronaaron5922
    @aaronaaronaaron5922 4 ปีที่แล้ว

    Great explanation!!! Thanks :D

  • @ahmad-murery
    @ahmad-murery 2 ปีที่แล้ว

    Very well explained,
    Thanks Ty

  • @Sarah-il5dr
    @Sarah-il5dr 3 ปีที่แล้ว

    This is a great video. Thanks

  • @NikunjSondagar
    @NikunjSondagar ปีที่แล้ว

    Nice video, Point to Point & clear explanation, keep it up.

  • @eggdressing
    @eggdressing 3 ปีที่แล้ว

    superb tutorial

  • @suchitnikam7334
    @suchitnikam7334 2 ปีที่แล้ว

    It's an Awesome explanation.

  • @pratyushraizada1472
    @pratyushraizada1472 4 ปีที่แล้ว

    Thanks Tyger!

  • @orestborovets2140
    @orestborovets2140 2 ปีที่แล้ว +1

    Wow, very descriptive tutorial. Many thanks. Sad that you stop creating new content =\

  • @DalasYoo
    @DalasYoo 3 ปีที่แล้ว

    Gotcha your youtube channel by git hook. Good description ^^

  • @josephh836
    @josephh836 4 ปีที่แล้ว +1

    Thanks for informative explanations.
    i have problem that i couldn't find out it.
    i have created a project by root in my UNIX system. then i make a lot of change on that. using git i give accessibility to a non root user "for example Alex" to pull and make his change on the project. but when he wanna write the change, permission denied massage is appeared and he can not write his change on the file. i checked the file permission and i saw the permission of all file and folder in project directory and sub directories change to "rw-r--x--". i wanna keep project file and folder permission on "chmod 666" and prevent change it through deployment by git. what should i do?

  • @mimosveta
    @mimosveta 3 ปีที่แล้ว

    thanks dude, this really clarified a lot. too bad you only have 3 videos

  • @AjithkumarSekar
    @AjithkumarSekar 3 ปีที่แล้ว

    8:50 is gst alias of git status by default! That's great. I didn't know that

    • @tygertec1
      @tygertec1  3 ปีที่แล้ว

      That was a function in my PowerShell profile:
      function gst { git status $args }

  • @schmen226
    @schmen226 5 ปีที่แล้ว

    Great stuff! Is it possible to enforce branch names created locally with a git branch '/ or same with git checkout -b? What event would that be keyed to?

    • @tygertec1
      @tygertec1  5 ปีที่แล้ว +1

      Thanks. :) As far as I know, what you describe isn't currently possible. Here's a full list of the available hooks:
      www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks
      I've never tried this, but I suppose you could use post-checkout to display a message or something indicating that the branch name was non-standard, but it wouldn't prevent creating the branch in the first place.

    • @notem1nomedisponivel
      @notem1nomedisponivel ปีที่แล้ว

      @@tygertec1 teste

  • @maidul13
    @maidul13 ปีที่แล้ว

    thank you s much

  • @pradipspeaks9395
    @pradipspeaks9395 ปีที่แล้ว

    Sir can I invoke yarn target like yarn lint from here?

  • @ashishpanwar4773
    @ashishpanwar4773 2 ปีที่แล้ว

    thanks @tygertec : Thanks but this global setting for core.hookspath will only be applicable incase i am using gitbash. What if i use any other tool like github desktop.
    my commit-msg hook is writting in shell which is not recoginsed by tools like github desktop or Tortoise git ..

  • @diptiranjan5728
    @diptiranjan5728 5 ปีที่แล้ว

    can i get the full code over here

  • @email989
    @email989 4 ปีที่แล้ว

    Still relevant. Still best explanation of git hooks. Only needed this to make it work w/ PowerShell: www.tygertec.com/git-hooks-practical-uses-windows/

  • @henson2k
    @henson2k 3 ปีที่แล้ว

    Windows doesn't have /bin/sh LOL

  • @PaladinforChrist
    @PaladinforChrist 5 ปีที่แล้ว +1

    Can hear your lips smacking ... good vid, but new mic please.