AI-powered git checkpoint and conflict resolution.
- git-checkpoint - Stages, commits, rebases onto main, and pushes. Handles submodules. Automatically resolves conflicts using the AI resolver. Commit messages are AI-narrated (see below).
- git-ai-resolver - Analyzes git conflicts using an LLM (via OpenAI-compatible API) and resolves them autonomously. Falls back to heuristics when AI is unavailable.
- gitmark-narrate - Derives the checkpoint commit message from the agent session's prompts + tool calls (bloodbank events via candystore) blended with the staged diff. Best-effort and time-bounded; falls back to a deterministic diff-summary when the event store or LLM is unavailable.
git clone https://github.com/delorenj/GitMark.git
cd GitMark
make installThis will:
- Symlink
git-checkpoint,git-ai-resolver, andgitmark-narrateinto~/.local/bin/ - Create
~/.config/GitMark/config.tomlwith defaults (if it doesn't exist) - Install lefthook pre-commit hooks (if lefthook is installed)
# macOS
brew install lefthook
# npm
npm install -g @evilmartians/lefthookThen run lefthook install in the repo to enable pre-commit hooks.
make uninstall~/.config/GitMark/config.toml
provider = "ollama"
model = "qwen3.5:35b"| Provider | Config value | API key env var | Endpoint |
|---|---|---|---|
| Ollama | ollama |
none (uses OLLAMA_HOST or localhost:11434) |
localhost:11434/v1 |
| OpenAI | openai |
OPENAI_API_KEY |
api.openai.com/v1 |
| OpenRouter | openrouter |
OPENROUTER_API_KEY |
openrouter.ai/api/v1 |
| Kimi for Coding | kimi |
KIMI_API_KEY |
api.kimi.com/coding/v1 |
All providers use the OpenAI-compatible chat-completions schema. Override the
config path with the GITMARK_CONFIG env var.
Kimi for Coding (Moonshot AI). The kimi-for-coding model id is stable — the
backend transparently maps it to the latest coding model:
provider = "kimi"
model = "kimi-for-coding"DeepSeek via OpenRouter (no separate provider needed — OpenRouter exposes it):
provider = "openrouter"
model = "deepseek/deepseek-v4-flash"# Checkpoint current repo (stage, commit, rebase, push)
git-checkpoint
# Checkpoint a specific repo
git-checkpoint ~/code/myproject
# Resolve conflicts in current repo
git-ai-resolver
# Resolve merge conflicts specifically
git-ai-resolver mergeInstead of a generic checkpoint: <timestamp> auto-commit, git-checkpoint
asks gitmark-narrate for a message that actually tells the story of the work.
It blends two sources:
- Intent — bloodbank events. The universal agent hooks publish every user
prompt and tool call to candystore. Narrate
queries that HTTP API for this repo's events since the last commit
(
GET /events?project=<repo>&from=<last-commit>&to=<now>), giving the why and the decision chain — often a more accurate account than the diff alone. - Ground truth — the staged diff.
git diff --stat, a truncated diff, and untracked files give the exact what.
Both are redacted for secret material, then a fast LLM (the same
config.toml provider/model and OpenAI-compatible path as git-ai-resolver)
produces a Conventional-Commits message (subject + short body + a
Checkpoint: <ts> (gitmark) trailer).
It is strictly best-effort and time-bounded — the checkpoint is never blocked or failed by narration:
- candystore down / no events → narrate uses the diff only;
- LLM unreachable, out of quota, or slower than the timeout → deterministic diff-summary message;
- narration disabled or times out entirely → plain timestamp message.
| Knob | Default | Effect |
|---|---|---|
GITMARK_FAST=1 / --fast |
off | Skip narration (fast timestamp/diff message) |
GITMARK_NARRATE=0 |
on | Disable narration entirely |
GITMARK_NARRATE_TIMEOUT |
45 |
Seconds git-checkpoint allows for narration |
GITMARK_NARRATE_PROVIDER / _MODEL |
config | Override just for narration (none = off) |
GITMARK_CANDYSTORE_URL |
http://127.0.0.1:8683 |
candystore query API |
Note: narration needs a fast provider to fit the timeout. Large local reasoning models (e.g. ollama
qwen3.x) frequently exceed it and trigger the deterministic fallback — configure a fast cloud model (Kimi/OpenRouter) for real narratives, and make sure its API key is present in the cron/hook environment, not just your interactive shell.
- bash, git, curl, jq
This repository uses lefthook to run pre-commit hooks that detect potential secrets:
- API keys (generic patterns, AWS keys, GitHub tokens, Slack tokens, etc.)
- Private keys (RSA, DSA, EC, PGP)
- Environment files (
.env,.local, etc.) - Credential files (
.aws/credentials,.ssh/id_*, etc.) - Passwords and tokens in config files
If a secret is detected, the commit will be blocked with instructions on how to proceed.
git commit --no-verifyEdit .lefthook-ignore to add file patterns that should be skipped:
# Example: Skip test fixtures with mock secrets
test/fixtures/*
# Example: Skip specific config files
*.config.json