对于我的全局gitignore,我想使用来自https://github.com/github/gitignore的多个最新的gitignore模板,用于操作系统/IDE/语言/框架(如macOS、Java、安卓和JetBrains )。
这里有一些解决方案可以在本地连接:
我可以在一个.gitignore文件中包括其他.gitignore文件吗?(类似于c类语言中的#include )
但我想知道是否有更优雅的解决方案,只需将最新的模板从指定的urls连接起来。
发布于 2018-11-06 02:48:01
git config --global core.excludesfile ~/.gitignore
# concatenating URLs
curl https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore > ~/.gitignore
# alternative pre-concatenated .gitignore service
curl -sL https://www.gitignore.io/api/c,c++ > ~/.gitignore每次启动shell并用存储库中的最新版本覆盖全局.bashrc文件时,.gitignore文件中的类似行都会运行。
发布于 2018-08-07 04:41:21
您所引用的内容筛选器驱动程序(以及我编写的)是在结帐时自动完成的。
该脚本可以做任何您想做的事情,包括获取这些远程gitignore文件的最新版本(例如,通过简单的curl ),并生成更新的级联文件。
发布于 2019-01-22 18:15:47
我运行了一个托管最大数量的gitignore模板的项目,它非常容易使用。
https://stackoverflow.com/questions/51717482
复制相似问题