Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何取消整个文件夹的版本设置?_Git - Fatal编程技术网

Git 如何取消整个文件夹的版本设置?

Git 如何取消整个文件夹的版本设置?,git,Git,我有一个git版本的文件夹。我想对它进行版本化,也就是删除.git元数据,我该怎么做 如果要从git中删除文件,但要将其保留在文件系统中,请添加选项--cached,谢谢 如果该文件夹是git存储库的顶层,并且您确实希望完全删除与该文件夹关联的整个git repo,那么只需从该文件夹中删除(隐藏).git目录: cd foldername rm -r .git 如果文件夹是git存储库的子目录,那么gautier的方法就是您想要的: git rm --cached -r foldername

我有一个git版本的文件夹。我想对它进行版本化,也就是删除.git元数据,我该怎么做


如果要从git中删除文件,但要将其保留在文件系统中,请添加选项--cached,谢谢


如果该文件夹是git存储库的顶层,并且您确实希望完全删除与该文件夹关联的整个git repo,那么只需从该文件夹中删除(隐藏)
.git
目录:

cd foldername
rm -r .git 
如果文件夹是git存储库的子目录,那么gautier的方法就是您想要的:

git rm --cached -r foldername/
git rm --cached -r foldername/