git-multibranch

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

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/Zurybr/lefarma-skills --skill git-multibranch-zurybr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-multibranch
Source: https://github.com/Zurybr/lefarma-skills/tree/main/letta/benchmarks/trajectory-only/git-multibranch
Command: npx skills add https://github.com/Zurybr/lefarma-skills --skill git-multibranch-zurybr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of deploying different branches of a Git repository to specific web-accessible directories, enabling automated and organized web content management.

Core Features & Use Cases

  • Branch-to-Directory Mapping: Automatically deploys content from distinct Git branches (e.g., main, dev) to corresponding web server directories.
  • Automated Deployment Hooks: Utilizes Git's post-receive hooks to trigger deployments upon code pushes.
  • Use Case: A development team can push features to a dev branch, which automatically deploys to a staging environment, while pushes to main deploy to the production website.

Quick Start

Configure your Git repository to automatically deploy the 'main' branch to '/var/www/main' and the 'dev' branch to '/var/www/dev'.

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 multi-branch deployment to web server directories?

Automate Git multi-branch deployment by configuring bare repositories with SSH access and post-receive hooks to map pushed branches directly to corresponding web-accessible directories. This enables automatic content delivery to distinct environments like staging and production.

What is a Git post-receive hook used for in branch-specific deployments?

A Git post-receive hook is used to trigger automated deployments to web servers upon code pushes. It checks the pushed branch name and routes the content to the specific web server directory mapped for that branch, such as routing 'dev' to staging.

Do I need SSH and bare repositories to set up branch-to-directory mapping?

Yes, setting up branch-to-directory mapping requires careful configuration of SSH, bare Git repositories, and web servers. These components establish the secure connection and trigger mechanisms necessary for seamless multi-branch integration.

Can I use this automated deployment for staging and production environments?

Yes, you can use this automated deployment for staging and production environments by mapping specific branches to distinct directories. Pushing features to a 'dev' branch deploys to staging, while pushes to 'main' update the production website automatically.

What's the best way to deploy a 'dev' branch to a staging environment automatically?

The best way to deploy a 'dev' branch to staging is using Git post-receive hooks within a bare repository. Configure the hook to detect pushes to 'dev' and automatically route the content to your designated staging web directory, such as '/var/www/dev'.

Why does multi-branch Git deployment require careful web server configuration?

Multi-branch Git deployment requires careful web server configuration to ensure seamless integration between SSH, Git, and the server. Proper setup guarantees that post-receive hooks correctly route branch-specific content to the correct accessible directories without permission errors.