我应该在哪里放置.gitignore来影响所有项目? [英] where should I put .gitignore to affect all projects?

查看:913
本文介绍了我应该在哪里放置.gitignore来影响所有项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在哪里放置 .gitignore 文件,以便我所有的项目都使用这些设置?

where should I place a .gitignore file so that all my projects use those settings?

我试过各种文件夹,只能将它放到我的项目文件夹中,但是这些设置(当然)只适用于该项目...不是我的其他项目。

I tried various folders and I can only get it to work if I put it in my project folder, but then the settings (of course) only are applied to that project... not my other projects.

推荐答案

您需要使用命令行。原因是,您需要将gitignore文件放在Eclipse项目的父目录中,但是您无法在Eclipse工作台中看到该目录(因为Eclipse项目是那里的顶级实体)。

You need to use the command line. The reason is, that you need to place the gitignore file in the parent directory of your Eclipse projects, but you cannot see that directory in the Eclipse workbench (as Eclipse projects are top level entities there).

例如你有2个Eclipse项目,这些项目存储在你的仓库中。

E.g. you have 2 Eclipse projects, which are stored like this in your repository

\mygitrepo\project1

\mygitrepo\project1

\mygitrepo\\\project2

\mygitrepo\project2

然后在mygitrepo目录中添加.gitignore文件。

then just add the .gitignore file in the mygitrepo directory.

这篇关于我应该在哪里放置.gitignore来影响所有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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