Git 忽略提交的文件
Git ignore committed files
我有一个小问题,但很麻烦。
在我的私有 git 存储库中,我添加了 temporary/cache 文件夹以进行推送,现在任何时候我的缓存文件请求都会被推送。如何设置忽略?
我尝试在 .gitignore 文件中设置 /temporary/cache 但它不起作用。
基本上,如果您阅读 git 文档,您会发现 gitignore 不是已添加到源代码管理的文件所在的位置
The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked.
To stop tracking a file that is currently tracked, use git rm --cached.
可以使用 .git/info/ 文件夹中的排除文件来忽略属于存储库一部分的文件,但 git 会将它们视为未更改的。
我有一个小问题,但很麻烦。 在我的私有 git 存储库中,我添加了 temporary/cache 文件夹以进行推送,现在任何时候我的缓存文件请求都会被推送。如何设置忽略?
我尝试在 .gitignore 文件中设置 /temporary/cache 但它不起作用。
基本上,如果您阅读 git 文档,您会发现 gitignore 不是已添加到源代码管理的文件所在的位置
The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked. To stop tracking a file that is currently tracked, use git rm --cached.
可以使用 .git/info/ 文件夹中的排除文件来忽略属于存储库一部分的文件,但 git 会将它们视为未更改的。