Configure Generator Ignore Rules¶
When you run regenerate, the GTB generator walks all skeleton template files and either writes or prompts to overwrite each one. If you've heavily customised certain files (CI workflows, build configs, Dockerfiles), you'll be prompted to decline overwrites every time.
The .gtb/ignore file lets you permanently mark files as "hands off" โ the generator will skip them without prompting.
Step 1: Create the Ignore File¶
Create .gtb/ignore in your project's .gtb/ directory (alongside manifest.yaml):
Step 2: Add Patterns¶
The syntax is gitignore-like. Add one pattern per line:
# Ignore my custom CI workflows
.github/workflows/**
# But keep the release workflow managed by the generator
!.github/workflows/release.yml
# Ignore my custom build config
justfile
# Ignore Docker files
Dockerfile
docker-compose.yml
Pattern Types¶
| Pattern | What it matches |
|---|---|
justfile |
Exact filename in any directory |
*.yml |
All .yml files in any directory |
.github/** |
Everything under .github/ |
.github/workflows/test.yml |
Exact path only |
!pattern |
Re-includes a file excluded by an earlier pattern |
# comment |
Ignored (comment line) |
Patterns are evaluated top-to-bottom. Later patterns override earlier ones โ this is how negation works.
Step 3: Regenerate¶
Run regenerate as normal:
Ignored files will be skipped silently. You'll see debug output for each skipped file if you run with --debug:
How Hashing Works¶
Ignored files are still tracked in the manifest. The generator reads the current on-disk content of each ignored file and records its hash. This means:
- The manifest stays accurate โ it reflects what's actually on disk
- Future regenerations know the file exists and hasn't been touched by the generator
- If you remove a file from
.gtb/ignorelater, the generator can detect whether you've modified it since the last regeneration
If an ignored file doesn't exist on disk (e.g. you deleted it), no hash is recorded.
Common Patterns¶
Protect All CI, Keep Release Managed¶
Protect Build Configuration¶
Protect Everything Except Go Code¶
Notes¶
- The
--forceflag does not override ignore rules. Ignored files stay ignored regardless. - Missing
.gtb/ignoreis valid โ the generator behaves exactly as before (no files ignored). - Blank lines and lines starting with
#are ignored. - Patterns without a
/match by filename (basename) in any directory. - Patterns with a
/match against the full relative path.
Related Documentation¶
- Generator Package โ full generator architecture and ignore file format
- Generator Ignore File Spec โ design specification