什么是.gitignore? [英] What is .gitignore exactly?

查看:96
本文介绍了什么是.gitignore?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建了一个Github存储库,并想知道 .gitignore 文件的用途。我开始时没有创建一个,但由于大多数存储库都有一个,因此添加了一个。
我需要一个吗?我能/我只是忽略它,还是有用处?
我对这个主题做了一些研究,但是找不到具体的解释。

解决方案

.gitignore 告诉git应忽略哪些文件(或模式)。它通常用于避免从工作目录提交对其他协作者无用的临时文件,例如编译产品,IDE创建的临时文件等。



您可以在此处查找完整详情。


I just created a Github repository and was wondering what the .gitignore file was for. I started by not creating one, but added one due to the fact that most repositories have one. Do I need to have one? Can/do I just ignore it, or does it have a use? I did some research on the subject but couldn't find a concrete explanation.

解决方案

.gitignore tells git which files (or patterns) it should ignore. It's usually used to avoid committing transient files from your working directory that aren't useful to other collaborators, such as compilation products, temporary files IDEs create, etc.

You can find the full details here.

这篇关于什么是.gitignore?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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