git-multibranch

Automate Git branch deployments to per-branch web server directories via post-receive hooks.

134|21|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/letta-ai/skills --skill git-multibranch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-multibranch
Source: https://github.com/letta-ai/skills/tree/main/ai/benchmarks/letta/terminal-bench-2/trajectory-feedback/git-multibranch
Command: npx skills add https://github.com/letta-ai/skills --skill git-multibranch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance for setting up Git-based deployment systems that deploy across multiple environments using separate branches (e.g., main and dev). It covers SSH authentication for Git, web server configuration to serve content from different branches, and post-receive hooks to automate deployments.

Core Features & Use Cases

  • SSH authentication setup for Git deployment users
  • Bare repository creation and multi-branch initialization (main, dev)
  • Web server configuration to serve per-branch deployments (e.g., /var/www/main, /var/www/dev)
  • Post-receive hooks to trigger automated deployments
  • End-to-end verification of branch deployments and access

Quick Start

Configure a bare repo, create main/dev branches, set up a post-receive hook to deploy to per-branch directories, and test pushes to verify correct deployment.

Frequently Asked Questions about git-multibranch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Git deployments across multiple environments using branches?

Automate Git deployments by configuring a bare repository with post-receive hooks that automatically deploy main and dev branches to separate web server directories. Set up SSH authentication, initialize branches, create per-branch deployment paths, and trigger deployments via hook scripts on each push.

What's the best way to set up SSH access for automated Git deployments?

SSH authentication for Git deployment requires configuring SSH keys for deployment users, setting appropriate file permissions on the bare repository, and restricting shell access to deployment scripts only. This ensures secure, automated pushes trigger deployments without manual intervention.

How do post-receive hooks automate branch deployments to web servers?

Post-receive hooks are scripts executed automatically after Git receives a push. They detect which branch was pushed, checkout the code to the corresponding deployment directory, and restart services. This eliminates manual deployment steps for each branch.

Can I deploy different Git branches to separate web server directories?

Yes. Create dedicated deployment directories for each branch (e.g., /var/www/main, /var/www/dev), configure your web server to serve from the appropriate path, and use post-receive hooks to checkout branch-specific code into the correct directory on each push.

What do I need to set up before configuring multi-branch Git deployments?

Prerequisites include SSH key setup for deployment users, a bare Git repository on the deployment server, web server installation and configuration, and knowledge of post-receive hook scripting. Verify SSH connectivity and repository initialization before testing branch deployments.

Why use bare repositories instead of standard Git repos for deployments?

Bare repositories have no working directory, preventing accidental edits and corruption. They're designed specifically for receiving pushes via SSH and are ideal for triggering automated workflows through post-receive hooks without conflicting with live code.