简体   繁体   English

暂时取消跟踪git中的文件

[英]Temporarily untrack files from git

I have a base install of ExpressionEngine (a CMS) which I clone for new projects. 我有一个ExpressionEngine(一个CMS)的基础安装程序,可为新项目克隆。

The base install has hundreds of core files that will never change, unless I install an update of expressionengine. 基本安装包含数百个永远不会更改的核心文件,除非我安装了expressionengine的更新。 Tracking all these files makes git very slow. 跟踪所有这些文件会使git非常慢。

So, I want to untrack all of them for during my development, and only track them when I install an update. 因此,我想在开发过程中取消跟踪所有对象,而仅在安装更新时跟踪它们。 What would be the best way to do this? 最好的方法是什么?

I have tried using .gitignore, but this isn't meant to ignore files that are already being tracked. 我尝试使用.gitignore,但这并不是要忽略已经被跟踪的文件。 Should I use exclude or assume-unchanged, or something else? 我应该使用排除或假定不变,还是其他?

If your project use an external library, you may want to use git submodule to include it in your repository, then go in that directory to git checkout the tag (or branch, or sha1) you want to use. 如果您的项目使用外部库,则可能要使用git submodule将其包含在存储库中,然后进入该目录以git签出要使用的标记(或分支或sha1)。

git init newproject
cd newproject
git submodule add https://url-or-path/to/base/ee-repository target_dir
cd target_dir
git checkout sometag
cd -
git add target_dir
git commit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM