git排除vs忽略 [英] git excludes vs ignores

查看:498
本文介绍了git排除vs忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用:


特定于特定存储库但不包含$ b的模式$ b不需要与其他相关存储库共享(例如,存储在存储库中但是特定于一个用户的
工作流的辅助
文件)应该放入$ GIT_DIR / info / exclude文件中。 / p>

请注意.git / info / exclude无法版本化,因为它位于.git目录中。


I use Tower for using Git in Mac. The settings in Tower has Ignores section which creates the .gitignore, but it has another section named "Excludes". And it seems like that one can use excludes with "# git ls-files --others --exclude-from=.git/info/exclude".

What Excludes is for? Why one needs excludes when gitignore is available?

解决方案

It's a list of files that are not in .gitignore (which can be versioned), but which you want to exclude on your machine's copy of the repo.

From the docs:

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user's workflow) should go into the $GIT_DIR/info/exclude file.

Note that .git/info/exclude can not be versioned because it's in the .git directory.

这篇关于git排除vs忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆