diff --git a/aider/commands.py b/aider/commands.py index fa504c5e7..5c02e3c11 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -327,7 +327,7 @@ class Commands: self.io.tool_output(f"Added {matched_file} to the chat") added_fnames.append(matched_file) - if self.coder.repo and git_added: + if self.coder.repo and git_added and self.coder.auto_commits: git_added = " ".join(git_added) commit_message = f"aider: Added {git_added}" self.coder.repo.commit(message=commit_message)