Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

.gitignore Doesn't Track my Files Even After Using "git rm -r --cached ." and "git add ."?

I've run "git rm -r --cached ." and "git add ." several times now trying to fix this, among other things. Nothing's worked yet.

I have this directory, I want the untracked files to be ignored. This is my .gitignore

Even when removing all cached files and readding everything, the untracked files still get tracked by git. My .gitignore is in the root of my repo, like it should be, and I believe I named all files correctly. Running "git ls-files . --ignored --exclude-standard --others" returns nothing, both when the files are tracked and untracked.

What's my issue here? Thank you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

torek's comment above worked. My .gitignore was stored as UTF-16-LE. Creating the .gitignore within VSCode caused the issue, and deleting that and creating it right on github fixed it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...