有些文件已经加入了Git管理,如何让Git不再管理这些文件,这时可以用git rm命令:
$ git rm -husage: git rm [<options>] [--] <file>...-n, --dry-run dry run-q, --quiet do not list removed files--cached only remove from the index-f, --force override the up-to-date check-r allow recursive removal--ignore-unmatch exit with a zero status even if nothing matched--sparse allow updating entries outside of the sparse-checkout cone--pathspec-from-file <file>read pathspec from file--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character
使用 git rm --cached 文件路径 就可以取消指定文件版本管理控制,--cached代表不删除本地文件。
