Skip to content

tgiffin/claude-code-git-safety-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Safety System - Full Documentation Archive

This folder contains the comprehensive enterprise-grade Git safety system that was created on January 20, 2026.

What's Here

This system includes:

  • Multiple Git hooks for protection
  • Automated backup scripts
  • GitHub Actions workflows
  • Extensive documentation and guides
  • Visual diagrams and cheat sheets

Why It's Archived

This was initially created in response to concerns about AI coding tools (like Claude Code) accidentally deleting projects. However, it turned out to be over-engineered for a solo developer's needs.

The project already had a good GIT_WORKFLOW.md guide, and a simpler interactive commit script was created instead.

What's Being Used Instead

In the main project root, you'll find:

  • commit.sh - Interactive commit script (asks before doing anything)
  • GIT_WORKFLOW.md - Updated with automation instructions
  • Simple, manual workflow that fits a solo developer

Using This Archive

For Education / Sharing with Others

All the documentation here is solid and can be used to:

  • Teach Git safety to teams
  • Share with other developers concerned about AI tool safety
  • Implement in larger/team projects
  • Learn advanced Git workflows

Key Files for Teaching:

  • START_HERE.md - Good overview of the system
  • PROJECT_SAFETY_GUIDE.md - Comprehensive safety practices
  • QUICK_REFERENCE.md - Emergency recovery commands
  • SAFETY_SYSTEM_OVERVIEW.md - Visual diagrams and flows
  • CHEAT_SHEET.txt - Printable reference card

Scripts You Can Reuse:

  • pre-commit - Hook that blocks mass deletions
  • pre-push - Hook that creates backups before push
  • backup-project.sh - Comprehensive backup script
  • commit-msg - Hook that shows commit summaries

Installing This System Elsewhere

If you want to use this full system on another project:

  1. Copy the hooks to .git/hooks/:

    cp pre-commit pre-push commit-msg /path/to/project/.git/hooks/
    chmod +x /path/to/project/.git/hooks/*
  2. Copy the backup script:

    cp backup-project.sh /path/to/project/
    chmod +x /path/to/project/backup-project.sh
  3. Copy the documentation you want:

    cp QUICK_REFERENCE.md SETUP_COMPLETE.md /path/to/project/
  4. Copy GitHub Actions workflow:

    mkdir -p /path/to/project/.github/workflows
    cp ../../../.github/workflows/backup.yml /path/to/project/.github/workflows/

System Overview

Protection Layers

  1. Pre-commit Hook - Blocks commits that delete >50% of files
  2. Pre-push Hook - Creates backup bundle before every push
  3. Commit-msg Hook - Shows change summary
  4. Backup Script - Creates comprehensive backups on demand
  5. GitHub Actions - Daily automated cloud backups
  6. Branch Protection - GitHub-level safety (setup guide included)

Documentation Structure

Getting Started:

  • START_HERE.md
  • SETUP_COMPLETE.md
  • INSTALLATION_SUMMARY.md

Daily Use:

  • QUICK_REFERENCE.md
  • CHEAT_SHEET.txt
  • SIMPLE_VERSION.md

Learning:

  • PROJECT_SAFETY_GUIDE.md
  • SAFETY_SYSTEM_OVERVIEW.md
  • INDEX.md

Configuration:

  • GITHUB_PROTECTION_SETUP.md
  • README_SAFETY_ADDITION.md

Why This Was Over-Engineered

The original request was about preventing project deletion by AI tools. The system created was enterprise-grade with:

  • 10+ documentation files
  • 6 layers of protection
  • Extensive guides and diagrams
  • Team-focused features

For a solo developer, this was overkill. The simple commit.sh script provides adequate protection with a better UX.

However, this comprehensive system is valuable for:

  • Teams
  • Larger projects
  • Educational purposes
  • Sharing with other developers

Credits

Created by Claude (Anthropic) on January 20, 2026 for the SWR Scenarios project.

Licensed under the same terms as the main project.


Note: If you're looking at this and thinking "this is way too much," you're right! See the main project's commit.sh and GIT_WORKFLOW.md for the simpler approach that was adopted instead.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors