diff --git a/aider/main.py b/aider/main.py index dd4304168..d00de8d77 100644 --- a/aider/main.py +++ b/aider/main.py @@ -296,11 +296,12 @@ def main(args=None, input=None, output=None): if not git_root and args.git: if io.confirm_ask("No git repo found, create one to track GPT's changes (recommended)?"): repo = git.Repo.init(os.getcwd()) + global_git_config = git.GitConfigParser([os.path.expanduser("~/.gitconfig")], read_only=True) with repo.config_writer() as git_config: - if not git_config.has_option("user", "name"): + if not global_git_config.has_option("user", "name"): git_config.set_value("user", "name", "Your Name") io.tool_error('Update git name with: git config --global user.name "Your Name"') - if not git_config.has_option("user", "email"): + if not global_git_config.has_option("user", "email"): git_config.set_value("user", "email", "you@example.com") io.tool_error( 'Update git email with: git config --global user.email "you@example.com"'