{"id":45278211,"url":"https://github.com/ersinkoc/git-commit-time-machine","last_synced_at":"2026-02-21T02:04:14.158Z","repository":{"id":323424143,"uuid":"1093216869","full_name":"ersinkoc/git-commit-time-machine","owner":"ersinkoc","description":"Comprehensive Git history manipulation tool with AI-powered commit message generation. Change commit dates, edit content, manage sensitive data, and generate creative commit messages using OpenAI, Anthropic, Google Gemini, and Local AI models.","archived":false,"fork":false,"pushed_at":"2025-12-18T10:17:34.000Z","size":492,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T17:24:31.336Z","etag":null,"topics":["commit","git"],"latest_commit_sha":null,"homepage":"https://ersinkoc.github.io/git-commit-time-machine/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ersinkoc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T04:23:19.000Z","updated_at":"2025-12-18T10:17:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ersinkoc/git-commit-time-machine","commit_stats":null,"previous_names":["ersinkoc/git-commit-time-machine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ersinkoc/git-commit-time-machine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2Fgit-commit-time-machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2Fgit-commit-time-machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2Fgit-commit-time-machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2Fgit-commit-time-machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ersinkoc","download_url":"https://codeload.github.com/ersinkoc/git-commit-time-machine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2Fgit-commit-time-machine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commit","git"],"created_at":"2026-02-21T02:04:01.358Z","updated_at":"2026-02-21T02:04:14.143Z","avatar_url":"https://github.com/ersinkoc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gctm - Git Commit Time Machine\n\n🚀 **Git Commit Time Machine v1.2.0** - Comprehensive Git history manipulation tool with AI-powered commit message generation. Change commit dates, edit content, manage sensitive data, and generate creative commit messages using OpenAI, Anthropic, Google Gemini, and Local AI models.\n\n**🎯 Version 1.2.0 Highlights:**\n- ✅ **100% Test Success Rate**: Achieved 512 tests passing with zero failures - complete reliability guarantee\n- 🔬 **Comprehensive Test Coverage**: 40+ new test cases covering all GitHistoryRewriter functionality and edge cases\n- 🛡️ **Enhanced Error Handling**: Improved timeout handling, branch validation, and null input protection\n- 📊 **Logger System Overhaul**: Completely rewritten logger tests with 100% method coverage including file operations\n- 🔧 **Backup Management**: Robust backup creation, restoration, and cleanup with comprehensive validation\n- 🚀 **Production-Ready**: Minor version bump reflecting significant stability and reliability improvements\n\n## ✨ Features\n\n- 🤖 **AI-Powered Commit Messages**: Generate creative commit messages using OpenAI, Anthropic Claude, or local AI models\n- 🌍 **Multi-Language Support**: Generate commit messages in 12 languages: English, Turkish, Spanish, French, German, Italian, Portuguese, Dutch, Russian, Japanese, Chinese, and Korean\n- 🎨 **Multiple Styles**: Choose from conventional, descriptive, minimal, or humorous commit message styles\n- ⚙️ **Customizable**: Configure AI providers, models, and settings to match your workflow\n- 🔄 **Git History Manipulation**: Change commit dates, edit commit messages, update commit content\n- 🛡️ **Security Features**: Sanitize sensitive data, manage API keys, backup and restore system\n\n## Installation\n\n### Option 1: Install via npm (Recommended)\n\n```bash\n# Install globally\nnpm install -g gctm\n\n# Or install locally\nnpm install gctm\n\n# Verify installation\ngctm --version\n```\n\n### Option 2: Clone from GitHub\n\n```bash\n# Clone the project\ngit clone https://github.com/ersinkoc/git-commit-time-machine.git\n\n# Change to project directory\ncd git-commit-time-machine\n\n# Install dependencies\nnpm install\n\n# Install globally\nnpm install -g .\n```\n\n### Option 3: Download and Install\n\n```bash\n# Download the latest release\nwget https://github.com/ersinkoc/git-commit-time-machine/archive/refs/tags/latest.tar.gz\n\n# Extract and install\ntar -xzf latest.tar.gz\ncd GitCommitTimeMachine-*\nnpm install -g .\n```\n\n### System Requirements\n\n- **Node.js**: \u003e= 14.0.0\n- **npm**: \u003e= 6.0.0\n- **Git**: \u003e= 2.0.0\n- **OS**: Windows, macOS, Linux\n\n### AI Setup (Optional)\n\nFor AI-powered commit messages, you'll need API keys:\n\n```bash\n# OpenAI (for GPT-5, GPT-4.1 models)\nexport OPENAI_API_KEY=\"your-openai-api-key\"\n\n# Anthropic Claude (for Claude 4.5, Claude 4.1 models)\nexport ANTHROPIC_API_KEY=\"your-anthropic-api-key\"\n\n# Google Gemini (for Gemini 2.5 models)\nexport GOOGLE_API_KEY=\"your-google-api-key\"\n\n# Local AI (via Ollama - requires installation)\n# No API key needed, runs locally\n```\n\n## Usage\n\n### CLI Usage\n\n#### Redate Commit Timestamps\n\n```bash\n# Redate commits within a specific date range\ngctm redate --start \"2023-01-01\" --end \"2023-01-30\"\n\n# Include backup\ngctm redate --start \"2023-01-01\" --end \"2023-01-30\" --backup\n\n# Interactive mode\ngctm redate --interactive\n```\n\n#### Edit Commit Message\n\n```bash\n# Edit a specific commit message\ngctm edit-message --commit \"a1b2c3d\" --message \"New commit message\"\n\n# Interactive mode\ngctm edit-message --interactive\n```\n\n#### Edit Commit Content\n\n```bash\n# Replace a specific pattern\ngctm edit-content --commit \"a1b2c3d\" --pattern \"API_KEY\" --replacement \"***HIDDEN***\"\n\n# Interactive mode\ngctm edit-content --interactive\n```\n\n#### Sanitize History\n\n```bash\n# Clean sensitive data\ngctm sanitize --patterns \"email,apiKeys\" --replacement \"***REDACTED***\"\n\n# Interactive mode\ngctm sanitize --interactive\n```\n\n### Backup Management\n\n```bash\n# Create backup\ngctm backup create --description \"Pre-operation backup\"\n\n# List backups\ngctm backup list\n\n# Restore backup\ngctm backup restore \u003cbackupId\u003e\n\n# Delete backup\ngctm backup delete \u003cbackupId\u003e\n```\n\n#### AI-Powered Commit Messages\n\n```bash\n# Generate AI commit messages (requires API key)\nexport OPENAI_API_KEY=\"your-openai-api-key\"\n\n# Basic AI generation\ngctm ai-generate\n\n# Generate in Turkish with humorous style\ngctm ai-generate --language tr --style humorous\n\n# Interactive selection and application\ngctm ai-generate --interactive\n\n# Generate with additional context\ngctm ai-generate --context \"Fixed critical authentication bug\"\n\n# Improve existing commit message\ngctm ai-generate --current-message \"fix bug\" --style descriptive\n```\n\n#### AI Configuration\n\n```bash\n# Show current AI configuration\ngctm ai-config --show\n\n# Set API key and provider\ngctm ai-config --api-key \"your-key\" --provider openai\n\n# Configure default language and style\ngctm ai-config --language tr --style humorous\n\n# Test AI connection\ngctm ai-config --test\n\n# Set model and creativity level (2025 models)\ngctm ai-config --model gpt-5-main --temperature 0.8\n```\n\n**AI Providers Supported:**\n- **OpenAI**: GPT-5 series (main, thinking), GPT-4.1 series, GPT-4o, legacy models\n- **Anthropic**: Claude 4.5 series, Claude 4.1 series, Claude Haiku 4.5, legacy models\n- **Google Gemini**: Gemini 2.5 Pro/Flash, Gemma 3, audio/video models\n- **Local**: Ollama with 100+ models including Llama 3.3, DeepSeek-R1, Phi-4, Qwen3\n\n**Languages Available:**\n- English (en), Turkish (tr), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt), Dutch (nl), Russian (ru), Japanese (ja), Chinese (zh), Korean (ko)\n\n**Commit Message Styles:**\n- Conventional, Descriptive, Minimal, Humorous\n\n### Programmatic Usage\n\n```javascript\nconst { GitCommitTimeMachine } = require('./src/index.js');\n\nconst gctm = new GitCommitTimeMachine();\n\n// Redate commits\nawait gctm.redateCommits({\n  startDate: '2023-01-01',\n  endDate: '2023-01-30',\n  createBackup: true,\n  preserveOrder: true,\n  filter: (commit) =\u003e commit.author === 'john.doe@example.com'\n});\n\n// Edit content\nawait gctm.editCommitContent({\n  commitId: 'a1b2c3d',\n  replacements: [\n    { pattern: /API_KEY=.*/g, replacement: 'API_KEY=***REDACTED***' }\n  ],\n  createBackup: true\n});\n\n// Sanitize history\nawait gctm.sanitizeHistory({\n  patterns: [\n    /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b/g, // Email\n    /([A-Z_]+_?(KEY|TOKEN|SECRET|PASSWORD|PASS|API_KEY|SECRET_KEY)=)([^\\s\\n]+)/g // API keys\n  ],\n  replacement: '***HIDDEN***',\n  createBackup: true\n});\n\n// Initialize AI assistant\nawait gctm.initializeAI();\n\n// Generate AI commit message\nconst aiResult = await gctm.generateAICommitMessage({\n  language: 'tr',\n  style: 'humorous',\n  context: 'Fixed critical bug in authentication system'\n});\n\nif (aiResult.success) {\n  console.log('AI Suggestions:', aiResult.suggestions);\n\n  // Apply the first suggestion\n  await gctm.applyAICommitMessage(aiResult.suggestions[0], true);\n}\n\n// Update AI configuration\nawait gctm.updateAIConfig({\n  apiKey: 'your-api-key',\n  provider: 'openai',\n  model: 'gpt-4',\n  language: 'en',\n  style: 'conventional'\n});\n```\n\n## API Reference\n\n### GitCommitTimeMachine Class\n\n#### Methods\n\n- `redateCommits(options)`: Redates commit timestamps\n- `editCommitMessage(options)`: Edits commit message\n- `editCommitContent(options)`: Edits commit content\n- `sanitizeHistory(options)`: Sanitizes repository history\n- `listBackups()`: Lists available backups\n- `restoreBackup(backupId)`: Restores a backup\n\n#### Options\n\n**redateCommits:**\n- `startDate`: Start date (YYYY-MM-DD)\n- `endDate`: End date (YYYY-MM-DD)\n- `filter`: Commit filtering function\n- `createBackup`: Create backup\n- `preserveOrder`: Preserve order\n\n**editCommitMessage:**\n- `commitId`: Commit ID to edit\n- `newMessage`: New commit message\n- `createBackup`: Create backup\n\n**editCommitContent:**\n- `commitId`: Commit ID to edit\n- `replacements`: Array of replacement patterns\n- `createBackup`: Create backup\n\n## Security Considerations\n\n- ⚠️ **Backup Important**: Always backup before important operations\n- ⚠️ **Shared Repositories**: Be careful when using in shared repositories\n- ⚠️ **History Changes**: Modified history can affect other developers\n- ✅ **Sensitive Data**: Securely manages API keys, passwords, and other sensitive information\n\n## Examples\n\n### Hiding API Keys\n\n```javascript\nconst gctm = new GitCommitTimeMachine();\n\n// Hide API keys in .env file\nconst result = await gctm.contentEditor.hideApiKeys(\n  './.env',\n  ['API_KEY', 'SECRET_KEY', 'DATABASE_URL'],\n  '***HIDDEN***'\n);\n\nconsole.log(result);\n```\n\n### Date Analysis\n\n```javascript\nconst gctm = new GitCommitTimeMachine();\nconst commits = await gctm.gitProcessor.getCommits();\n\n// Which days commits were made\nconst dayStats = gctm.dateManager.analyzeCommitDays(commits);\nconsole.log(dayStats);\n\n// Which hours commits were made\nconst hourStats = gctm.dateManager.analyzeCommitHours(commits);\nconsole.log(hourStats);\n```\n\n### Sensitive Data Detection\n\n```javascript\nconst content = await fs.readFile('config.js', 'utf8');\nconst sensitiveData = gctm.contentEditor.detectSensitiveData(content);\n\nconsole.log('Detected sensitive data:', sensitiveData);\n```\n\n## Contributing\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Frequently Asked Questions (FAQ)\n\n**Q: How can I restore changed history?**\nA: Use `gctm backup restore \u003cbackupId\u003e` to restore a previously created backup.\n\n**Q: Can this be used in shared repositories?**\nA: Yes, but be cautious. After making changes, you may need to `git push --force` to reflect changes to others.\n\n**Q: Which file formats can be edited?**\nA: All text-based files (.js, .py, .json, .env, .md, etc.) can be edited.\n\n**Q: Where are backups stored?**\nA: Backups are stored in the `.gctm-backups` folder in the project directory.\n\n## Version \u0026 License\n\n- **Version**: 1.1.6\n- **License**: MIT License\n- **Author**: ERSIN KOC\n- **Repository**: https://github.com/ersinkoc/git-commit-time-machine\n\n### License\n\nCopyright (c) 2025 ERSIN KOC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersinkoc%2Fgit-commit-time-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fersinkoc%2Fgit-commit-time-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersinkoc%2Fgit-commit-time-machine/lists"}