Zulip Git integration

Get Zulip notifications for pushes to your Git repositories!

Note that Zulip also offers integrations for GitHub, GitLab and various other version control hosting services.

  1. Create a bot for Git. Make sure that you select Incoming webhook as the Bot type.

  2. Download and install our Python bindings and example scripts on the system where the Git integration script will be run from.

  3. If your Git server and your Zulip server are on the same machine, symlink the post-receive hook of your Git repository in your Git server by running:

    ln -s /usr/local/share/zulip/integrations/git/post-receive your-repo.git/hooks/post-receive

    Otherwise, copy the post-receive hook to your Git repository's /hooks directory.

    The post-receive hook is triggered on every push to the repository.

  4. Open /usr/local/share/zulip/integrations/git/zulip_git_config.py with your favorite editor, and change the following lines to specify the email address and API key for your Git bot:

    ZULIP_USER = "git-bot@chat.zulip.org"
    ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
    ZULIP_SITE = "https://chat.zulip.org"
    
  5. Copy the config file to the same directory as the post-receive hook.

    cp /usr/local/share/zulip/integrations/git/zulip_git_config.py your-repo.git/hooks

Use the test-post-receive branch to test the integration without modifying your main branch.

Configuration options

In /usr/local/share/zulip/integrations/git/zulip_git_config.py, you can set:

  • The channel where notifications are sent by updating the value of STREAM_NAME. By default, notifications are sent to a channel named "commits".

  • Which branches send notifications when pushed by updating the commit_notice_destination function. By default, pushes to the main, master, and test-post-receive branches will result in notifications.

  • The message format used in your Zulip notifications by updating the format_commit_message function.

Logos are trademarks of their respective owners. None of the integrations on this page are created by, affiliated with, or supported by the companies represented by the logos.