Thanks to visit codestin.com
Credit goes to github.com

Skip to content

djdarcy/git-repokit

Repository files navigation

RepoKit

GitHub Workflow Status Version Python License GitHub Discussions

Transform chaotic code folders into professional, organized repositories that work seamlessly with GitHub and teams.

RepoKit automates the creation of standardized Git repositories with professional structure, worktree-based and branching workflows, and GitHub/Gitlab/etc deployment pipelines. Whether you're starting fresh or organizing existing code, RepoKit provides the structure and tools for professional development.

Why RepoKit?

Before: Scattered files, no organization, deployment nightmares
After: Professional structure, team-ready, GitHub-ready, portfolio-worthy

New to RepoKit? Read Why RepoKit Exists for the complete picture.

Features

Core Capabilities

  • Universal Bootstrap System: Analyze and migrate ANY project to RepoKit structure
  • Standardized Repository Structure: Consistent directory layout with standard folders
  • Multi-Branch Strategy: Automatic setup of main, dev, staging, test, live, and private branches
  • Worktree Management: Git worktrees for efficient branch isolation and parallel development
  • Private Content Protection: Secure local-only content that never gets pushed
  • GitHub/GitLab Integration: Automated repository creation and deployment
  • AI Development Integration: Built-in Claude AI assistance with workflow documentation
  • Template Customization: Language-specific templates (Python, JavaScript, etc.)
  • Comprehensive Test Framework: Unit, integration, and end-to-end testing

Universal Project Support

  • Empty Projects: Start fresh with optimal structure
  • Existing Code: Preserve your files while adding RepoKit benefits
  • Git Repositories: Maintain full history while upgrading workflow
  • Complex Projects: Handle multi-branch, multi-contributor scenarios
  • Legacy Codebases: Safe migration with conflict resolution

📦 Installation

# Install from source
git clone https://github.com/djdarcy/git-repokit.git
cd git-repokit

# Install in development mode with all dependencies
pip install -e ".[dev]"

# Or install for regular use
pip install -e .

🎯 Quick Start

Create a New Project

# Basic project creation
repokit create my-awesome-project --language python

# Create and deploy to GitHub in one command
repokit create my-project --language python --publish-to github --private-repo

# Create with AI integration
repokit create my-project --ai claude --publish-to github

Adopt an Existing Project

# Analyze what RepoKit will do
repokit analyze .

# Adopt in-place with safe strategy
repokit adopt . --publish-to github --private-repo

# Migrate to new structure (creates copy)
repokit migrate ./old-project ./new-project

🔧 Common Use Cases

1. Brand New Python Project

# Create project with GitHub deployment
repokit create awesome-api \
  --language python \
  --description "My awesome Python API" \
  --publish-to github \
  --private-repo \
  --ai claude

2. Existing Project Migration

# First, analyze your project
cd existing-project
repokit analyze .

# Then adopt with recommended settings
repokit adopt . \
  --migration-strategy safe \
  --publish-to github \
  --organization my-company

3. Legacy Project Modernization

# Analyze complex project
repokit analyze ./legacy-app

# Adopt with careful conflict handling
repokit adopt ./legacy-app \
  --strategy safe \
  --branch-strategy gitflow \
  --dry-run  # Preview changes first

4. Multi-Language Monorepo

# Create with custom structure
repokit create platform \
  --language generic \
  --directories "backend,frontend,shared,docs,infra" \
  --branches "main,develop,release,hotfix" \
  --publish-to github

📊 Project Analysis

RepoKit can analyze any project and provide migration recommendations:

repokit analyze /path/to/project

# Output includes:
# - Project type (empty, source_no_git, git_with_history, etc.)
# - Detected primary language
# - Migration complexity (low/medium/high)
# - Recommended migration strategy
# - Recommended branch strategy
# - Step-by-step migration plan

🌳 Branch Strategies

RepoKit supports multiple branching strategies:

Standard (Default)

private → dev → main → test → staging → live

Simple

private → dev → main

GitFlow

private → feature/* → develop → release/* → main
                  ↘                    ↗
                    hotfix/* →  →  → ↗

GitHub Flow

private → feature/* → main

Custom

repokit create my-project \
  --branches "main,develop,qa,production" \
  --worktrees "main,develop"

🔐 GitHub/GitLab Integration

Initial Setup

# Store GitHub credentials (one time)
repokit store-credentials --publish-to github --token YOUR_TOKEN

# Or use environment variable
export GITHUB_TOKEN=YOUR_TOKEN

Automatic Deployment

# Create and deploy in one command
repokit create my-project --publish-to github --private-repo

# Deploy to organization
repokit create team-project \
  --publish-to github \
  --organization my-company \
  --private-repo

🤖 AI Integration

RepoKit includes Claude AI integration for enhanced development:

# Create project with AI assistance
repokit create my-project --ai claude

# This adds:
# - CLAUDE.md with project context
# - Development workflow instructions
# - Problem-solving methodology (The Process)
# - Private documentation structure

📁 Directory Structure

RepoKit creates an organized project structure:

my-project/
├── local/          # Main repository (private branch)
│   ├── docs/       # Documentation
│   ├── tests/      # Test files
│   ├── scripts/    # Utility scripts
│   ├── private/    # Local-only content
│   │   └── claude/ # AI assistance docs
│   └── ...
├── github/         # Main branch worktree
└── dev/           # Development branch worktree

🧪 Testing

RepoKit includes a comprehensive test framework:

# Run all tests
python tests/run_tests.py

# Run specific test categories
python tests/run_tests.py --unit        # Fast unit tests
python tests/run_tests.py --integration # CLI integration tests
python tests/run_tests.py --github      # GitHub API tests (requires token)

# Check test environment
python tests/run_tests.py --check

📚 Documentation

Getting Started

Reference Guides

💡 Pro Tip: Start with the Documentation Guide for easier perusal and recommended reading order.

🛠️ Configuration

RepoKit uses hierarchical configuration:

  1. Default values (built-in)
  2. Global config (~/.repokit/config.json)
  3. Project config (./.repokit.json)
  4. Environment variables (REPOKIT_*)
  5. CLI arguments (highest priority)

Example Configuration

{
  "name": "my-project",
  "language": "python",
  "branches": ["main", "develop", "staging"],
  "worktrees": ["main", "develop"],
  "user": {
    "name": "Your Name",
    "email": "[email protected]"
  },
  "github": true,
  "private_repo": true
}

Contributing

Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines. Please feel free to open issues or submit pull requests.

Like the project?

"Buy Me A Coffee"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Tool for creating standardized Git repositories with complex branching strategies

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •