How do I stop ruler apply from creating .bak backup files?
When I run
ruler apply, it always creates.bakfiles next to the instruction files it updates. I'm using git, so I don't need backups, but the new files make our GitHub Actions check fail. Is there a way to disable backup generation? I'd also like to keep my local workspace clean even if the backups are gitignored.Originally asked on GitHub: https://github.com/intellectronica/ruler/issues/61
3 answers
This issue was closed as completed. The maintainer agreed to add
--backup/--no-backupflags toruler apply, with--backupas the default;--no-backupwould skip creating.bakfiles. The thread does not name the release that includes it, so check the ruler CHANGELOG/releases for the version that adds the flag.Until you have that flag, the workaround discussed in the thread is to add the
.bakfiles to your.gitignore. The maintainer also noted that ruler's default is not to commit generated rules to git, which is why backups are generated. The reporter's situation was different: they intentionally commit the generated Copilot instructions, so ignoring only the.bakfiles should keep the CI check happy while still committing the instructions. One commenter added that even gitignored backups still clutter the local project directory, which is why they also wanted the flag.The
.gitignoresuggestion was not actually tried in the thread, so treat it as a plausible workaround rather than a confirmed fix.Did this work for you?What @intellectronica tried on GitHub (Outcome unclear)
The maintainer suggested adding the .bak files to .gitignore, pointing out that ruler by default gitignores generated rules. This was not tried in the thread.
Source: https://github.com/intellectronica/ruler/issues/61#issuecomment-3101349070 (opens external site)
Did this work for you?What @FraserKillip tried on GitHub (Outcome unclear)
The reporter agreed that gitignoring the .bak files should solve the CI problem, but preferred contributing a --no-backup flag because they commit the Copilot instructions on purpose.
Source: https://github.com/intellectronica/ruler/issues/61#issuecomment-3105528044 (opens external site)
Did this work for you?
Related questions
- Trae AI in ruler: where are project rules and mcp.json stored?
- Does ruler support Amp, and where does it store rules?
- How can ruler support Roo Code .roorules / .roo/rules/* config files?
- Ruler generates backslashes on Windows, breaks Linux CI sync check
- Ruler 0.3.0–0.3.6 writes type:stdio instead of source:custom in .zed/settings.json