Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI

on:
pull_request:
workflow_dispatch:

jobs:
rust-ci:
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ path = "src/main.rs"
[dependencies]
anyhow = "1"
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
toml = "0.8"
ureq = "2"

[dev-dependencies]
Expand Down
105 changes: 97 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ Set up a git repo the way you actually work — one guided flow for hooks, `.git
## Features

- **🪄 Guided repo setup** — Configure hooks, `.gitignore`, `.gitattributes`, and git config in one interactive flow.
- **📊 Status overview** — See what's currently configured with `gitkit status`.
- **🔁 Clone and bootstrap** — Clone a repo and drop straight into the setup wizard.
- **🧰 Hook management** — Install, list, show, or remove built-in hooks, or wire up your own command.
- **🧩 Ignore and attribute presets** — Browse built-in and gitignore.io templates, then apply line-ending or binary presets.
- **⚙️ Curated git config** — Apply practical presets like auto-upstream, autocorrect, histogram diffs, zdiff3, rerere, and delta pager setup.
- **⚙️ Curated git config** — Apply practical presets with `--global` or `--local` scope, with idempotency detection.
- **💾 Save & reuse builds** — Save configurations and apply them to any project with one command.
- **📦 Single binary** — No Node.js, no Python, no extra runtime.

---
Expand Down Expand Up @@ -84,18 +86,24 @@ Remove-Item "$env:LOCALAPPDATA\gitkit\gitkit.exe" -Force

## Quick Start

**Clone and configure a repo in one command:**
**Run the wizard (no arguments needed):**

```bash
gitkit clone https://github.com/user/repo
gitkit
```

Or configure an existing repo:
Or explicitly:

```bash
gitkit init
```

**Clone and configure a repo in one command:**

```bash
gitkit clone https://github.com/user/repo
```

Or use commands directly:

```bash
Expand All @@ -107,21 +115,58 @@ gitkit config apply defaults

---

## `gitkit status`

Show what's currently configured in your repo and globally.

```bash
gitkit status
```

**Output example:**

```
Hooks:
✓ conventional-commits (commit-msg)
✓ custom: pre-push → "cargo test"

.gitignore:
✓ 14 patterns

.gitattributes:
✓ line-endings (eol=lf)

Git config (local):
(none)

Git config (global):
✓ push.autoSetupRemote = true
✓ help.autocorrect = prompt
✓ diff.algorithm = histogram
```

---

## `gitkit init`

Interactive wizard that guides you through configuring a repo step by step.
Interactive wizard that guides you through configuring a repo step by step. Shows what's already configured and allows removal.

- Hooks — built-ins pre-selected, or add a custom command
- Hooks — shows installed hooks, pre-selects them, allows removal
- `.gitignore` — filterable search across all gitignore.io templates + built-ins
- `.gitattributes` — line endings and binary file presets
- Git config — 6 individual options, recommended ones pre-selected
- Git config — shows current values, allows removal
- Custom hooks — interactive picker for hook type selection

Automatically initializes a git repository if one doesn't exist:
Run without arguments or explicitly:

```bash
gitkit
# or
gitkit init
```

Automatically initializes a git repository if one doesn't exist.

---

## `gitkit clone`
Expand Down Expand Up @@ -194,6 +239,50 @@ The wizard runs automatically after cloning, allowing you to configure hooks, `.
| `gitkit config apply defaults` | `push.autoSetupRemote`, `help.autocorrect`, `diff.algorithm` |
| `gitkit config apply advanced` | `merge.conflictstyle zdiff3`, `rerere.enabled` |
| `gitkit config apply delta` | `core.pager delta` (requires `cargo`) |
| `gitkit config show` | Show current git config values |

**Scope options:**

- `--global` — Apply to global git config (all repos)
- `--local` — Apply to local repo config only
- Default: `--local` if in a repo, `--global` otherwise

**Idempotency:**

Configs already set with the same value show `(already set)` and are skipped.

```bash
$ gitkit config apply defaults --global
✓ push.autoSetupRemote = true (already set)
✓ help.autocorrect = prompt (already set)
✓ diff.algorithm = histogram (already set)

All configs already applied.
```

### Build

Save and reuse configurations across projects.

| Command | Description |
|---|---|
| `gitkit build list` | List saved builds |
| `gitkit build save <name>` | Save current repo config as a build |
| `gitkit build apply <name>` | Apply a saved build |
| `gitkit build delete <name>` | Delete a saved build |

**Example:**

```bash
# Save current configuration
gitkit build save rust-dev --description "Rust development setup"

# Apply to another project
cd /path/to/other/project
gitkit build apply rust-dev
```

Builds are saved to `~/.gitkit/builds/` as TOML files.

---

Expand Down
Loading
Loading