我有两个文件需要添加到 git:
modified: source_files/aws_environments/aws_account_numbers_no_spectrum.txt
modified: source_files/aws_environments/aws_environments_no_spectrum.txt
我尝试使用以下命令将这两个文件添加到 git:
git add source_files/aws_environments/aws_{accountnumbers,environments}_no_spectrum.txt
但是当我运行该命令时我得到了这个结果:
fatal: pathspec 'source_files/aws_environments/aws_accountnumbers_no_spectrum.txt' did not match any files
我做错了什么?如何正确地将两个文件指定给 git?
答案1
您的文件名为,和aws_account_numbers_no_spectrum.txt
之间有下划线。您的语法正确,但缺少下划线。account
numbers
正确的命令是:
git add source_files/aws_environments/aws_{account_numbers,environments}_no_spectrum.txt