git excludes vs ignores

孤街醉人 提交于 2019-12-03 03:34:17

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/10066749/git-excludes-vs-ignores

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!