Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


Our hosting is kindly provided by Josh from AnHonestHost.com. We would appreciate it if you could donate to help reduce his costs in funding the hosting.
He is also accepting bitcoins to 1KsxJr9HtsdaUeU7yaV9bk9bQi21UPBtUq

hpr2446 :: Git server and git hooks

Klaatu talks about running git on a server, and explains git hooks.

<< First, < Previous, Next >, Latest >>

Hosted by klaatu on 2017-12-18 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (0)

A sample post-receive git hook:


#!/usr/bin/tcsh

foreach arg ( $< )
  set argv = ( $arg )
  set refname = $1
end

set branch = `git rev-parse --symbolic --abbrev-ref $refname`
echo $branch

    if ( "$branch" == "master" ) then
      echo "Branch detected: master"
      echo "Do some stuff here."
    else if ( "$branch" == "dev" ) then
      echo "Branch detected: dev"
      echo "Do something else here."
      else
        echo "Do something entirely different here."
    endif

Comments

Subscribe to the comments RSS feed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to
record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?
Are you a spammer →
Who hosted this show →
What does HPR mean to you ?