Skip to content

Commit a1bf909

Browse files
Initial commit
0 parents  commit a1bf909

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+14220
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
8+
- package-ecosystem: "devcontainers"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/deploy-pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build-and-deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Build for Pages
38+
run: npm run build
39+
env:
40+
VITE_BASE: "/git-history-cleaner/"
41+
GITHUB_TOKEN: ${{ github.token }}
42+
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v4
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: './dist'
50+
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*-dist
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
27+
.env

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 AndreaGriffiths11
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PRD.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Git History Cleaner
2+
3+
Generate safe, customizable scripts to clear git repository history while preserving current files and creating proper backups.
4+
5+
**Experience Qualities**:
6+
1. **Trustworthy** - Users feel confident the tool won't accidentally destroy their work through clear warnings and backup creation
7+
2. **Efficient** - Quick generation of ready-to-use scripts without manual editing required
8+
3. **Educational** - Users understand what each command does through clear explanations and optional command breakdown
9+
10+
**Complexity Level**: Light Application (multiple features with basic state)
11+
- Handles user input, script generation, and provides educational context without requiring user accounts or complex state management
12+
13+
## Essential Features
14+
15+
### Script Generation
16+
- **Functionality**: Generate customized git history clearing scripts based on repository name and user preferences
17+
- **Purpose**: Eliminates manual script writing and reduces command errors
18+
- **Trigger**: User enters repository name and clicks generate
19+
- **Progression**: Input repo name → Configure options → Generate script → Copy/download script
20+
- **Success criteria**: Generated script contains correct repo name and all necessary safety commands
21+
22+
### Safety Options
23+
- **Functionality**: Toggle backup creation, confirmation prompts, and branch name customization
24+
- **Purpose**: Prevents accidental data loss and accommodates different workflow preferences
25+
- **Trigger**: User adjusts toggles before script generation
26+
- **Progression**: Default safe settings → User customizes → Settings reflected in generated script
27+
- **Success criteria**: Script reflects all selected safety options accurately
28+
29+
### Command Explanation
30+
- **Functionality**: Breakdown of what each git command does with plain English explanations
31+
- **Purpose**: Educates users about git operations and builds confidence in script safety
32+
- **Trigger**: User clicks on info icons or "Explain Commands" section
33+
- **Progression**: View script → Click explanation → Understand each step → Execute with confidence
34+
- **Success criteria**: Clear, non-technical explanations for each git operation
35+
36+
### Script Output Options
37+
- **Functionality**: Copy to clipboard, download as .sh file, or view in expandable code block
38+
- **Purpose**: Flexible script delivery matching different user workflows and environments
39+
- **Trigger**: User selects preferred output method after generation
40+
- **Progression**: Generate script → Choose output format → Copy/download → Execute in terminal
41+
- **Success criteria**: Script is properly formatted and executable in chosen format
42+
43+
## Edge Case Handling
44+
45+
- **Invalid Repository Names**: Sanitize input and show format requirements (alphanumeric, hyphens, underscores)
46+
- **Empty Input**: Disable generate button and show helpful placeholder text
47+
- **Very Long Repository Names**: Truncate display but preserve full name in script
48+
- **Special Characters**: Strip dangerous characters and warn user about modifications
49+
- **Copy Failures**: Provide fallback manual selection and download option
50+
51+
## Design Direction
52+
53+
The design should feel professional and trustworthy like a developer tool, while remaining approachable enough for less experienced users - clean, technical aesthetic with clear visual hierarchy that emphasizes safety and reliability over flashy interactions.
54+
55+
## Color Selection
56+
57+
Complementary (opposite colors) - Using a blue-green technical palette with orange accents to create trust through cool colors while using warm highlights for important actions and warnings.
58+
59+
- **Primary Color**: Deep Blue `oklch(0.45 0.15 240)` - Communicates reliability and technical professionalism
60+
- **Secondary Colors**: Cool Gray `oklch(0.85 0.02 240)` for backgrounds and Muted Blue `oklch(0.65 0.08 240)` for secondary actions
61+
- **Accent Color**: Warning Orange `oklch(0.68 0.18 45)` for attention-grabbing elements like copy buttons and important warnings
62+
- **Foreground/Background Pairings**:
63+
- Background (White `oklch(1 0 0)`): Dark Gray text `oklch(0.25 0.02 240)` - Ratio 12.6:1 ✓
64+
- Card (Light Gray `oklch(0.98 0.01 240)`): Dark Gray text `oklch(0.25 0.02 240)` - Ratio 11.8:1 ✓
65+
- Primary (Deep Blue `oklch(0.45 0.15 240)`): White text `oklch(1 0 0)` - Ratio 8.9:1 ✓
66+
- Accent (Warning Orange `oklch(0.68 0.18 45)`): White text `oklch(1 0 0)` - Ratio 5.2:1 ✓
67+
68+
## Font Selection
69+
70+
Technical and clean typeface that conveys precision and reliability while remaining highly readable for code snippets and technical instructions.
71+
72+
- **Typographic Hierarchy**:
73+
- H1 (App Title): Inter Bold/32px/tight letter spacing
74+
- H2 (Section Headers): Inter SemiBold/20px/normal spacing
75+
- Body Text: Inter Regular/16px/relaxed line height
76+
- Code Blocks: JetBrains Mono Regular/14px/monospace for script output
77+
- Labels: Inter Medium/14px/slight letter spacing for form elements
78+
79+
## Animations
80+
81+
Subtle functionality-focused animations that provide immediate feedback without drawing attention away from the technical content - smooth state transitions and gentle hover effects reinforce the tool's reliability.
82+
83+
- **Purposeful Meaning**: Smooth transitions communicate system responsiveness and build trust in the tool's precision
84+
- **Hierarchy of Movement**: Primary focus on copy button success states and form validation feedback, minimal decorative motion
85+
86+
## Component Selection
87+
88+
- **Components**:
89+
- Card for main script generator container with subtle borders
90+
- Input with clear labeling and validation states
91+
- Button variants (primary for generate, secondary for copy actions)
92+
- Switch components for safety toggles with clear on/off states
93+
- Collapsible for command explanations to reduce cognitive load
94+
- Textarea for script output with monospace font
95+
- Alert components for warnings and success messages
96+
97+
- **Customizations**:
98+
- Custom syntax highlighting for bash commands in script output
99+
- Copy button with animated success state and clipboard integration
100+
- Info tooltips for technical terms and safety explanations
101+
102+
- **States**:
103+
- Buttons show loading, success (copied), and error states clearly
104+
- Input fields highlight validation errors with helpful messaging
105+
- Toggles have distinct visual feedback for enabled/disabled
106+
- Script output area shows generated/empty states
107+
108+
- **Icon Selection**:
109+
- Copy icon for clipboard actions
110+
- Download icon for file export
111+
- Info/Question icons for help tooltips
112+
- Check icons for success confirmations
113+
- Terminal icon for script representation
114+
115+
- **Spacing**:
116+
- Consistent 4/6/8 Tailwind spacing scale
117+
- Generous padding (p-6/p-8) for main containers
118+
- Tight spacing (gap-2/gap-4) for related form elements
119+
- Larger gaps (gap-6/gap-8) between distinct sections
120+
121+
- **Mobile**:
122+
- Single column layout with full-width cards
123+
- Larger touch targets (min 44px) for buttons and toggles
124+
- Collapsible sections for script output to save vertical space
125+
- Simplified button groupings with priority-based stacking

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# 🧹 Git History Cleaner
2+
3+
A user-friendly tool to generate customizable scripts for clearing git repository history while preserving your current files.
4+
5+
[![Deploy to GitHub Pages](https://github.com/AndreaGriffiths11/git-history-cleaner/actions/workflows/deploy-pages.yml/badge.svg)](https://github.com/AndreaGriffiths11/git-history-cleaner/actions/workflows/deploy-pages.yml)
6+
7+
## 🚀 Live Demo
8+
9+
Try it out: **[https://andreagriffiths11.github.io/git-history-cleaner/](https://andreagriffiths11.github.io/git-history-cleaner/)**
10+
11+
## ✨ Features
12+
13+
- **Safe Script Generation** - Creates customized bash scripts with proper safety checks
14+
- **Backup Options** - Automatically includes backup creation commands
15+
- **Command Explanations** - Learn what each git command does in plain English
16+
- **Multiple Output Formats** - Copy to clipboard, download as .sh file, or view inline
17+
- **Input Validation** - Sanitizes repository names and prevents common errors
18+
- **Customizable** - Configure branch names and safety options
19+
20+
## 🛠️ Local Development
21+
22+
### Prerequisites
23+
- Node.js 20 or higher
24+
- npm
25+
26+
### Setup
27+
28+
```bash
29+
# Clone the repository
30+
git clone https://github.com/AndreaGriffiths11/git-history-cleaner.git
31+
cd git-history-cleaner
32+
33+
# Install dependencies
34+
npm install
35+
36+
# Start development server
37+
npm run dev
38+
39+
# Build for production
40+
npm run build
41+
```
42+
43+
## 📦 Tech Stack
44+
45+
- **React 19** - UI framework
46+
- **TypeScript** - Type safety
47+
- **Vite** - Build tool
48+
- **Tailwind CSS** - Styling
49+
- **Radix UI** - Accessible component primitives
50+
- **Phosphor Icons** - Icon library
51+
- **Sonner** - Toast notifications
52+
53+
## 🔒 Safety First
54+
55+
This tool generates scripts that **permanently delete git history**. Always:
56+
- ✅ Create backups before running any generated scripts
57+
- ✅ Review and understand each command
58+
- ✅ Get team approval for shared repositories
59+
- ✅ Test on a copy of your repository first
60+
61+
## 🤝 Contributing
62+
63+
Contributions are welcome! Please feel free to submit a Pull Request.
64+
65+
## 📄 License
66+
67+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
68+
69+
---
70+
71+
Built with ❤️ & 🤖

SECURITY.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
This project is actively maintained. Security updates will be applied to the latest version.
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| Latest | :white_check_mark: |
10+
11+
## Reporting a Vulnerability
12+
13+
If you discover a security vulnerability in this project, please help us keep the project safe by reporting it responsibly.
14+
15+
**Please do not create public GitHub issues for security vulnerabilities.**
16+
17+
Instead, please email me directly at [[email protected]] with:
18+
19+
- A description of the vulnerability
20+
- Steps to reproduce the issue
21+
- Potential impact
22+
- Any suggested fixes (if you have them)
23+
24+
I'll respond within 48 hours and work with you to understand and address the issue.
25+
26+
## Security Considerations
27+
28+
This tool generates bash scripts that modify git repositories. Users should:
29+
30+
- Always create backups before running generated scripts
31+
- Review and understand each command before execution
32+
- Never run scripts on production repositories without proper testing
33+
- Be cautious when sharing or storing generated scripts as they may contain repository names
34+
35+
## Scope
36+
37+
Since this is a client-side web application that generates scripts locally, the main security concerns are:
38+
39+
- Cross-site scripting (XSS) prevention
40+
- Input sanitization for repository names
41+
- Safe script generation practices
42+
43+
Thank you for helping keep this project secure!

components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/main.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

0 commit comments

Comments
 (0)