git remove file from tracking without deleting code example
Example 1: remove file from git tracking
git rm --cached <file_name>
Example 2: remove folder from repo but keep locally
git rm -r --cached File-or-FolderName
git commit -m "Removed folder from repository"
git push origin master
Example 3: git remove remote file keep local
# for single file
git rm --cached myfile
# for directory file
git rm --cached --r myfile