git-safety

Enforce safe Git operations by blocking destructive commands during push, reset, and cleanup workflows.

14.1k|606|Updated Oct 16, 2020
One-click install
npx skills add https://github.com/tamagui/tamagui --skill git-safety-tamagui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-safety
Source: https://github.com/tamagui/tamagui/tree/main/.claude/skills/git-safety
Command: npx skills add https://github.com/tamagui/tamagui --skill git-safety-tamagui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git safety rules to prevent destructive operations and irreversible data loss by enforcing best practices during common Git workflows.

Core Features & Use Cases

  • Prevent destructive commands: Stop or warn on force pushes, hard resets, and dangerous git clean operations.
  • Promote safer workflows: Encourage using stash, pull before push, and explicit permission for risky actions.
  • Use Case: In a collaborative environment, applying these rules reduces the risk of irreversible changes when multiple developers push in quick succession.

Quick Start

Apply the git-safety rules before making any push to this repository, and confirm any risky actions (force push, hard reset, or cleaning operations) with the team.

Frequently Asked Questions about git-safety

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

FAQPage Schema
How do I prevent force push and hard reset in my Git repository?

Git-safety enforces safe Git operations by blocking or warning on destructive commands like force push, hard reset, and git clean. It prompts for explicit permission or suggests safer alternatives such as stash or pull --rebase to protect collaborative work from irreversible data loss.

What's the best way to stop destructive Git commands in a team environment?

Apply git-safety rules before pushing to enforce policy checks across your workflow. The Skill prevents force push, hard reset, and dangerous cleanup operations, requiring team confirmation for risky actions and promoting stash, rebase, and explicit permission workflows instead.

Can I use Git safety rules to reduce accidental data loss in shared repositories?

Yes. Git-safety applies during push, reset, and cleanup workflows to prevent irreversible changes when multiple developers work in quick succession. It stops destructive operations and encourages safer practices like pull before push and explicit team approval.

Why should I enforce safer Git workflows instead of allowing force push?

Force push and hard reset can overwrite teammates' work without recovery. Git-safety prevents these operations by default, reducing the risk of irreversible data loss and enforcing best practices that keep collaborative repositories stable and recoverable.

How do I prompt developers to confirm risky Git operations?

Git-safety implements policy checks that prompt for confirmation on force push, hard reset, and git clean operations. It encourages using stash, pull --rebase, or explicit permission workflows, ensuring developers make intentional choices about potentially destructive actions.