My .gitignore file is NOT ignoring anything [closed]

Is there any particular valid reason as to why my .gitignore file is ignoring the fact that I have told this file to ignore all of my newly-created, previously-uncommitted files that I have included in my .gitignore file?

Here is my setup:

#.gitingore
/hello/logging_config.py
#root
<Project>
   |--hello
      |---logging_config.py
|--.gitignore

Despite the fact that the logging_config.py file is included in the .gitignore file, it continues to keep the file with the status of untracked.

Even when running git status, it still returns:

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        hello/logging_config.py

I should not be seeing this. In addition, the capital U stays next to the filename in the Source Control panel. I fail to see why my .gitignore file cannot tell Git to ignore the file. What am I doing wrong here?

I double checked for any typos in the spelling of the file names. Added trailing slashed, removed trailing slashed. Added leading slashes, removed leading slashes. Restarted VSC.

Ran:

git rm -r --cached .
git add .
git commit -m "Fixed untracked files"

Nothing worked.
Here is my directory tree

Update:

VSC is just returning silly, non-existent issues. I’m running the tree command, and it does not return half the files, I run run -a and it tells me there are no sub paths despite the fact that I can see the subfolders in the directory in the left held panel.

It is not recognising files despite spelling them correctly, it is giving me non-existent issues

Seriously, why does VSC make this so difficult? Why is this so impossible? Why is something that should be so simple be absolutely impossible? Why does this work for everyone else but not for me?

I am really getting to the end of my patience here. I just cant get anything to work! I could just scream.

13

An underscore and dot are different characters.

    hello/logging_config.py
                 X
      |---logging.config.py

5

I have just tried out exactly what you said you have. It works as expected. Therefore, you must be doing something different than you described. Why don’t you try it in a fresh project and see what you get:

mkdir fresh
cd fresh
git init
echo  hello/logging_config.py > .gitignore
mkdir hello
echo whatever > hello/logging_config.py
git status

I get this; what do you get?

On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .gitignore

nothing added to commit but untracked files present (use "git add" to track)

PS. This is an answer, since it (hopefully) tells the OP how to solve their problem.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật