git-initial-setup

Automates GitLab project and repository setup for streamlined onboarding and management.

2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/RyoMurakami1983/skills_repository --skill git-initial-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-initial-setup
Source: https://github.com/RyoMurakami1983/skills_repository/tree/main/skills/git-initial-setup
Command: npx skills add https://github.com/RyoMurakami1983/skills_repository --skill git-initial-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the setup of essential Git protections, ensuring that your main branch is always safeguarded against accidental direct commits or pushes, thereby maintaining code integrity and stability.

Core Features & Use Cases

  • Branch Protection Rules: Configures GitHub settings to require pull requests for merges into the main branch.
  • Local Hook Installation: Installs pre-commit and pre-push Git hooks to prevent direct commits and pushes to protected branches locally.
  • Global Hook Defaults: Sets up Git to use a global hooks path, ensuring new repositories automatically inherit these protections.
  • Use Case: When initializing a new project or onboarding a new team member, running this skill ensures that all developers adhere to a safe and standardized Git workflow from the outset, preventing common mistakes that could destabilize the main branch.

Quick Start

Run the setup script to install Git hooks for the current repository.

Frequently Asked Questions about git-initial-setup

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

FAQPage Schema
How do I prevent direct commits to the main branch in Git?

To prevent direct commits to the main branch, you can configure GitHub branch protection rules to require pull requests and install local pre-commit Git hooks to block unauthorized changes automatically.

How do I set up Git hooks globally for all repositories?

You can set up Git hooks globally by configuring a global hooks path in your Git settings, ensuring new repositories automatically inherit pre-commit and pre-push protections for the main branch.

What is the best way to enforce a pull request only workflow on GitHub?

The best way to enforce a pull request only workflow is to apply GitHub branch protection rules on the main branch combined with local Git hooks to prevent direct pushes and maintain code stability.

Do I need GitHub branch protection if I already have local Git hooks installed?

Yes, you need GitHub branch protection because local Git hooks only prevent accidental direct pushes on your machine, while remote branch protection rules strictly enforce the pull request workflow for all team members.

Can I automate Git branch protection setup for new project onboarding?

Yes, you can automate Git branch protection setup for new project onboarding by running a script that configures GitHub settings and installs local hooks to ensure developers follow a standardized workflow.