在团队开发中使用git来进行版本控制,常常要根据项目的内容来对.gitignore来进行配置
这方面我们可以参考https://github.com/github/gitignore来进行配置

vendor/
node_modules/

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

# Laravel 5 & Lumen specific
bootstrap/cache/
.env.*.php
.env.php
.env

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

对于laravel来说,因为国内的composer下载速度很慢,所以可以将vendor/和node_modules保留下来,不列入忽略

对于使用phpstorm来进行开发的小伙伴来说,一定有被.idea里面频繁更新的文件搞得不胜其烦的经历,所以在项目开始之前,一定记住要把.idea/*文件下所有的文件给排除

其实https://github.com/github/gitignore中Global部分也对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
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.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

如果有需要更精细配置的,也许可以参考以上内容


Git

登陆发表评论