I recently added .gitignore to the project, in order to make it work, I used git rm --cached to remove redundant files, but when I checked with git status, I found that these files are actually untracked, I want to know why they are untracked files and not tracked files.
--Update--
I know these files should not be added to git, maybe I am not clear, because I added gitignore later, so I want to remove git's control of these files now, but after removal they become untracked , but some files are staged and marked as delete, so I just wonder why only these files become untracked after I use git rm --cached.
.gitignore
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
app/build/
app/release/
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof
