Un-ignore all files in global .gitignore

半城伤御伤魂 提交于 2019-12-19 05:47:20

问题


After looking at git ignore exception, I realized that one can ignore files in a repository from a global .gitignore file.

Is there any way that you can override all rules from the global .gitignore file, so that the repository will have everything in it and nothing ignored? (besides un-ignoring every file individually)


回答1:


Create a .gitignore in the repo folder with one rule:

!*

This forgets the rules (with !) of all of the files (*) in the main .gitignore.




回答2:


You can.

Create you own .gitignore file with appropriate rules and put into directory in where it shall apply. The rules will be applicable for a directory with local .gitignore and its subdirs.



来源:https://stackoverflow.com/questions/26678955/un-ignore-all-files-in-global-gitignore

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