From 172df73b85c450aeb99811cc777acfeb059d450a Mon Sep 17 00:00:00 2001 From: Chris McCormick Date: Sat, 14 Feb 2026 20:42:06 +0800 Subject: [PATCH] Allow adding files outside repo when git commits off. --- aider/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index b9a3d3c2a..e104f6eca 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -846,7 +846,11 @@ class Commands: for matched_file in sorted(all_matched_files): abs_file_path = self.coder.abs_root_path(matched_file) - if not abs_file_path.startswith(self.coder.root) and not is_image_file(matched_file): + if ( + not abs_file_path.startswith(self.coder.root) + and not is_image_file(matched_file) + and self.coder.auto_commits + ): self.io.tool_error( f"Can not add {abs_file_path}, which is not within {self.coder.root}" )