摘要:
远端删除文件而不影响本地文件git rm [-r]--cached file_or_dir_name利用.gitignore来自动删除所有匹配文件我试过网上推荐的写法git rm --cached git ls-files -i --exclude-from=.gitignore gitcommit -m 'Removed all files that are in the .gitignore'git push origin master --exclude-from=.gitignore顺便可以简写成-X .gitignore,所以是这样:git rm --cached g 阅读全文