diff --git a/aider/commands.py b/aider/commands.py index fa504c5e737..5c02e3c114e 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -327,7 +327,7 @@ def cmd_add(self, args): 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)