什么包含在gitignore中的Laravel和PHPStorm项目?

时间:2014-09-09 15:12:22

标签: php git laravel phpstorm

我将使用Laravel和PHPStorm合作开展一个项目。在做了一些研究并开展了一些项目之后,到目前为止我已经提出.gitignore了。

/bootstrap/compiled.php
/vendor
/node_modules
composer.phar
composer.lock
.env.*.php
.env.php
.DS_Store
workspace.xml
Thumbs.db

是否还有其他可能导致冲突的文件?

编辑:

对于任何想知道为什么Flosculus评论存在的人,我最初发布我的git历史记录中出现了.idea / workspace文件的问题,他的回答是如何删除它。

4 个答案:

答案 0 :(得分:24)

除非PHPStorm是项目的官方部分(例如,它由公司强制执行,或由所有团队成员同意),我建议您将其忽略设置放入.git/info/exclude而不是.gitignore {1}}。前者是您的副本的本地副本,后者应该被提交并共享。

gitignore.io建议this for Laravel

# Created by https://www.gitignore.io/api/laravel

### Laravel ###
vendor/
node_modules/
npm-debug.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot
storage/*.key
.env.*.php
.env.php
.env
Homestead.yaml
Homestead.json

# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/

this for PHPStorm

# Created by https://www.gitignore.io/api/phpstorm

### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### PhpStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

顺便说一下,gitignore.io可以是accessed via the command-line,所以你可以做一些事情,比如

gi laravel,phpstorm >> .gitignore

这是一个非常方便的小工具。

答案 1 :(得分:1)

我使用了这个智能的.gitignore文件;),希望它可以对某人有所帮助:

/node_modules
# ignore log files and databases
*.log
*.sql
*.sqlite
# ignore compiled files
*.com
*.class
*.dll
*.exe
*.o
*.so
# ignore packaged files
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# ignore OS generated files
ehthumbs.db
Thumbs.db
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
# ignore Editor files
*.sublime-project
*.sublime-workspace
*.komodoproject
_ide_helper.php
/.idea
/.vscode
# Eclipse project files
.buildpath
.project
.settings/
# Ignore cache
.cache/
# Ignore user created files :)
*.bak
*.orig
# Ignore system files
.bash_history
LICENSE_AFL.txt
LICENSE.html
LICENSE.txt
LICENSE_EE*
RELEASE_NOTES.txt
.ssh/
error_log
.htpasswds
/.htaccess
php.ini.sample
.modgit/
_vti_bin/
_vti_cnf/
_vti_inf.html
_vti_log/
_vti_pvt/
_vti_txt/
tmp/
php.ini
_old/
.htpasswds/
.htpasswd
.viminfo
.profile
.bashrc
.bash_logout
.modman/
pkginfo
nohup.out
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache
#Laravel Specific files
/vendor
.env
/public/.htaccess
/storage
storage/*.key

答案 2 :(得分:0)

rm -rf .idea
git-ignore .idea/
git commit -a -m 'deleted and ignored .idea/'

重新加载项目。

答案 3 :(得分:0)

Laravel在安装时自动创建它:

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log