I'm on windows 10 and I'm trying to add some changes to a file to a branch.
I'm going:
git add aws_ec2_list_instances.py
And when I got git status nothing is added:
$ git status
On branch python
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: __pycache__/web_scraper.cpython-37.pyc
modified: __pycache__/web_scraper.cpython-38.pyc
modified: aws_s3_list_buckets.py
modified: web_scraper.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
../../output_files/
aws_ec2_list_instances_old.py
../../source_files/
no changes added to commit (use "git add" and/or "git commit -a")
Doing a git add --all or git add --force gives the same result. Nothing is added!
If I list the directory aws_ec2_list_instances.py is there:
git ls-files
__pycache__/web_scraper.cpython-37.pyc
__pycache__/web_scraper.cpython-38.pyc
aws_ec2_list_instances.py
aws_s3_list_buckets.py
web_scraper.py
I'm on this version of git for windows: git version 2.24.1.windows.2
How can I solve this?
aws_ec2_list_instances.pyhave any changes? What do you see when you rungit diff -- aws_ec2_list_instances.py?aws_ec2_list_instances.pyis the same as what is already committed or it is listed in.gitignore.git add aws_ec2_instances.pydoes nothing when I do a git status.git statusoutput, four underchanges not staged for commitand three underuntracked files. None of these seven exactly match the stringaws_ec2_list_instances.py. So I would not expectgit addto do anything here. Separately: You can view what's in the index (ALL of it, it will be very long in most cases) withgit ls-files, orgit ls-files --stageorgit ls-files --debugfor extra detail.git show HEAD:./aws_ec2_list_instances.pyto see what's in that copy of the file, if it exists at all, andgit show :./aws_ec2_list_instances.pyto see what's in the index copy of the file, if it exists at all. My guess is that both files exist and are identical to each other and to the copy in./aws_ec2_list_instances.py.