Skip to content

setup.sh does not generate .gitignore for new projects #174

@serejke

Description

@serejke

Bug

ralph-setup (via setup.sh) does not create a .gitignore in newly created projects. This causes Ralph's runtime/service files to be tracked by git.

Expected behavior

New projects created with ralph-setup my-project should include a .gitignore that excludes Ralph's runtime files, matching the patterns already defined in create_files.sh (lines 672-720).

Current behavior

setup.sh copies PROMPT.md, fix_plan.md, AGENT.md, and generates .ralphrc, but never creates a .gitignore. As a result, files like .ralph/.call_count, .ralph/status.json, .ralph/logs/*, and other transient state files get committed to git on the first ralph run.

Root cause

create_files.sh contains a comprehensive .gitignore (lines 672-720) but it's only written into the ralph-claude-code tool repository itself. setup.sh doesn't reference or replicate it for new projects.

Suggested fix

Either:

  1. Add a .gitignore template to templates/ and copy it in setup.sh (consistent with how other templates are handled), or
  2. Generate it inline in setup.sh (like .ralphrc is generated)

The .gitignore should include at minimum:

.ralph/.call_count
.ralph/.last_reset
.ralph/.loop_start_sha
.ralph/.exit_signals
.ralph/.circuit_breaker_state
.ralph/.circuit_breaker_history
.ralph/.ralph_session
.ralph/.ralph_session_history
.ralph/.claude_session_id
.ralph/.response_analysis
.ralph/progress.json
.ralph/status.json
.ralph/live.log
.ralph/logs/*
!.ralph/logs/.gitkeep
.ralph/docs/generated/*
!.ralph/docs/generated/.gitkeep

Affected versions

Current main branch. Also affects ralph-enable and ralph-enable-ci (checked lib/enable_core.sh — same omission).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions