有些文件已经加入了Git管理,如何让Git不再管理这些文件,这时可以用git rm命令:

    1. $ git rm -h
    2. usage: git rm [<options>] [--] <file>...
    3. -n, --dry-run dry run
    4. -q, --quiet do not list removed files
    5. --cached only remove from the index
    6. -f, --force override the up-to-date check
    7. -r allow recursive removal
    8. --ignore-unmatch exit with a zero status even if nothing matched
    9. --sparse allow updating entries outside of the sparse-checkout cone
    10. --pathspec-from-file <file>
    11. read pathspec from file
    12. --pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character

    使用 git rm --cached 文件路径 就可以取消指定文件版本管理控制,--cached代表不删除本地文件。