Automation with Git Hooks
videos

Automation with Git Hooks

Tutorial Details
  • Topic: Git
  • Difficulty: Intermediate
  • Estimated Completion Time: 20 min
  • Git Logo: Jason Long

As web developers, we always want to speed up our workflows, right? Of course, automation is the best way to do that. In this quick tip, I’ll teach you one way to use Git hooks to automate part of your development workflow.


Screencast


Links

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Akshay

    Running at 2X?

  • Oscar B.

    Hohoho. Yes. 2x.

    Great anyway. I generally prefer written information over videos because I can go as fast as I need when reading. So this video is fine for me XD

    Andrew, awesome post as always.

    • http://www.emirates.com anjum shaikh

      Yes agree with @Oscar as i am reading this from office here they have block many sites including this vidoe site :( as i can see only “Access to this web page is restricted”. They should add some text information

  • http://andrewburgess.ca Andrew Burgess
    Author

    Thanks, guys! Actually, It’s not running at 2x; I just talk too fast and crop out pauses too tightly. :)

  • http://www.stefanjudis.de stefan

    THX. really useful. will use it in my next project.

  • http://www.deluxeblogtips.com Rilwis

    Great quick video as usual! But what impressed me is the way you work with bash. If you have time, please share some tips to speedup working in bash. Thanks.

    PS: Do you have “follow comment” checkbox? I’d like to keep following this post discussion.

  • http://www.github.com/chintanparikh Chintan

    Git hooks are rather amazing.

    One thing I picked up on your video. There are more than those 8 hooks you mentioned (eg post-checkout, etc).

    If anyone’s looking for a neat usage of git hooks, I hacked this up a few days ago:
    https://github.com/chintanparikh/Timetracker

    I’m basically using the post-checkout hook to record how much time I spend on each branch. This works really well for me because the place where I intern requires us to record hours, and each different task is seen as a different branch.

  • http://digitale-avantgarde.com chp

    Huh, this is really cool. I always wanted to dive deeper into GIT, this came in handy. Thanks.

  • http://www.xcellence-it.com Xcellence IT

    Great tool to speedup the things… Is there anything similar for Subversion?

  • http://notes.kloop.kg Said Kaldybaev

    Really cool, need to try hooks ))) thanks author!

  • Denis

    Cool video!
    Help me, need tree commands )

  • http://karlis.me Karlis

    This can be done in much simpler way:

    #! /bin/bash
    mocha
    exit $?

    All mocha success/error messages are visible and script exits with the mocha exit status (the $?).

  • Marco Pedraza

    Excelent!, Great video!

  • me

    Very cool, thanks.

  • http://nddery.ca Nicolas

    Wow that was fast (but still legible)! Never heard about git hooks before but I’ll make sure to try them out, especially that deploy one on StackOverflow!

    Thanks!

  • http://andrewburgess.ca Andrew Burgess
    Author

    Thanks everyone!

    @Rilwis: Thanks! What parts of my terminal workflow interested you?

    @Chintan: Thanks for pointing that out!

    @Denis: Install homebrew, and then run brew install tree

    @Karlis: Didn’t know that; thanks!

  • Tony

    Another amazing tutorial Andrew !

  • https://github.com/js-coder Florian

    Yay, another awesome git tutorial. :)

    tree is also really cool. On Debian you can get it by running sudo apt-get install tree.

  • http://www.deluxeblogtips.com Rilwis

    @Andrew: auto complete command, editing with vim, etc. Not much in the video, but I think you have some hotkeys or some tips to speed up working with bash. I’m just curious to see how other developers working with it :)

  • Americo

    This is a Great Video

  • http://www.williamwalker.me William

    Well that was fast!

    Although I like the look of Git, I’m actually drawn to Mercurial more. I think they are both very good systems but obviously Git gains a lot of users and popularity thanks to GitHub. At work though, we use Subversion which also has hooks but we don’t have any set up.

    Great video though, thanks for sharing.