Find us on facebook

Jan 31, 2018

Git - Slack integration

  • cd to your bare repo eg:project.git and cd to hooks and create post-receive hook
  • Add bash commands to push related information to slack. (You can find many bash scripts published in the internet or you can write your own script referring following parameters in the post-receive hook.
    oldrev
    newrev
    refname
  • Give permission 
chmod +x post-receive
  • cd to your bare repo eg:project.git and execute following commands
git config -f config hooks.slack.webhook-url 'https://hooks.slack.com/services/xxx.....'

git config hooks.slack.channel '#development-xxx'

No comments:

Post a Comment