git 移除项目版本控制_git 移除文件夹的版本控制

在使用git进行版本控制时可能需要忽略掉某些文件的版本控制,必须编译的文件和一些不必要的缓存文件

例如:[Bb]in/obj/.vs/ 等

但如果这些文件已经加入了版本控制再修改 .gitignore 文件则不会生效;

此时可以使用 git rm 命令将已加入版本控制的文件移除版本控制

命令地址:https://git-scm.com/docs/git-rm

git-rm - Remove files from the working tree and from the index

SYNOPSIS

git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] …​

DESCRIPTION

Remove files from the index, or from the working tree and the index. git rm will not remove a file from just your working directory. (There is no option to remove a file only from the working tree and yet keep it in the index; use /bin/rm if you want to do that.) The files being removed have to be identical to the tip of the branch, and no updates to their contents can be staged in the index, though that default behavior can be overridden with the -f option. When --cached is given, the staged content has to match either the tip of th

你可能感兴趣的:(git,移除项目版本控制)