2015-11-05 59 views
5

使用Laravel 5.x.或5.1.x
.hgignore文件的基本推荐配置是什么?Laravel 5 - Mercurial推荐.hgignore

从拉的.gitignore这就是我:

syntax: glob 
.env 
.gitignore 
.gitattributes 
.idea 
vendor/ 
node_modules/ 
Homestead.yaml 
Homestead.json 

网上我看到的版本4讲讲/bootstrap/compiled.php
我应该包括/引导/缓存?

+0

一般:这将频繁出现在库目录,但不应成为它的一部分的一切。 – planetmaker

+0

我发现在某些文件结构中保留.gitignore文件会创建一个锚,允许提交空文件夹,如/ storage/cache// storage/sessions /和/ storage/views/ – ScraperDave

+0

mercurial仅在其存储库中使用.hgignore根文件夹(和你的全局文件夹) – planetmaker

回答

2

我用排除模式,包括空的文件夹结构:

## Laravel specific 
^\.env$ 
^vendor 

## General 
\.DS_Store$ 
[Tt]humbs\.db$ 

## Keep these folders, but ignore their content 
^bootstrap/cache/(?!\.gitignore).+$ 
^storage/logs/(?!\.gitignore).+$ 
^storage/app/(?!\.gitignore).+$ 
^storage/framework/views/(?!\.gitignore).+$ 
^storage/framework/sessions/(?!\.gitignore).+$ 
^storage/framework/cache/(?!\.gitignore).+$ 
+0

嘿@JannieT。我试过你的例子,但它似乎不适合我。例如,我仍然在storage/framework/views下看到我所有的观点,前面。我真的很想得到这个工作。任何其他的想法,为什么我仍然会看到这些文件?谢谢 –

+0

@GotTheFeverMedia,你可能有'syntax:glob'包含吗?它可能会搞砸了。另外,请确保在该文件夹中有一个.gitignore文件。 –

+0

@GotTheFeverMedia作为最后的手段,根据文档,你也可以指定一个子文件夹特定的忽略:“子目录可以有自己的'.hgignore'设置,通过添加'subinclude:path/to/subdir/.hgignore'到根''.ggignore'。但是这里没有必要,我的工作完全没有它 –