I'm trying to exclude the pycache directory with these lines:
aws_scripts/python/aws_tools/__pycache__/
*.pyc
I can list that directory from my current location:
ls .\aws_scripts\python\aws_tools\__pycache__\
    Directory: C:\Users\bluet\OneDrive\Desktop\important_folders\Jokefire\git\jf_cloud_scripts\aws_scripts\python\aws_tools\__pycache__
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
la---           5/16/2021 10:47 PM            763 aws_add_sg_list.cpython-39.pyc
la---           5/16/2021 10:47 PM           1173 aws_tag_resources.cpython-39.pyc
la---           5/16/2021 10:47 PM            894 banners.cpython-39.pyc
la---           5/16/2021 10:47 PM           1148 choose_accounts.cpython-39.pyc
la---            5/4/2021  8:10 AM          12871 ec2_mongo.cpython-38.pyc
la---           5/15/2021 10:01 AM          15714 ec2_mongo.cpython-39.pyc
la---           5/16/2021 10:47 PM            811 find_vpcs.cpython-39.pyc
la---           5/16/2021 10:47 PM           1183 init.cpython-39.pyc
la---           5/16/2021 10:47 PM            848 list_new_instances.cpython-39.pyc 
la---           5/16/2021 10:47 PM            937 modules.cpython-39.pyc
la---           5/16/2021 10:47 PM            665 read_account_info.cpython-39.pyc  
la---           5/16/2021 10:47 PM           6764 user_input.cpython-39.pyc
Yet, when I do a git status it still shows me the __pycache__ directory:
git status        
On branch develop
Your branch is up to date with 'origin/develop'.
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    aws_scripts/python/aws_tools/.gitignore
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:   .gitignore
        modified:   aws_scripts/python/aws_tools/__pycache__/ec2_mongo.cpython-39.pyc
What am I doing wrong?
 
     
    