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

Categories

0 votes
3.8k 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...