什么应该是grails3.1.x最好的gitignore?

时间:2016-04-02 11:07:08

标签: grails gitignore grails-3.1

由于grails 3.1.x有重大变化,所以适当的.gitignore?

目前,我已使用默认Grails .gitignore

4 个答案:

答案 0 :(得分:6)

所有以前的帖子都提供了合理的建议。这里是Grails 3项目中.gitignore文件的良好起点(请注意,此处排除的前4行是IntelliJ项目文件,可能/可能不是您关心的问题):

*.iml
*.ipr
*.iws
.idea

.gradle
.asscache
build
out
logs
classes

答案 1 :(得分:5)

我的团队通常使用不同的操作系统(Win / Lin)以及各种协作工具和编辑器。所以我为我的团队使用IntelliJ开发了一个标准的.gitignore,它可以在许多系统和编辑器上正常工作。这是:

# Created by .ignore support plugin (hsz.mobi)
### Grails template
# .gitignore for Grails 1.2 and 1.3
# Although this should work for most versions of grails, it is
# suggested that you use the "grails integrate-with --git" command
# to generate your .gitignore file.

# web application files
/web-app/WEB-INF/classes

# default HSQL database files
/prodDb.*
/devDb.*

# general HSQL database files
*Db.properties
*Db.script

# logs
/stacktrace.log
/test/reports
/logs

# project release file
/*.war

# plugin release files
/*.zip
/plugin.xml

# older plugin install locations
/plugins
/web-app/plugins

# "temporary" build files
/target
### Java template
*.class
*.asscache
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see     http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### NetBeans template
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

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

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.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:
*.ipr
*.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
### Eclipse template
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch


 # JDT-specific (Eclipse Java Development Tools)
.classpath

 # Java annotation processor (APT)
 .factorypath


 # Ignore Gradle GUI config
 gradle-app.setting

 # Avoid ignoring Gradle wrapper jar file (.jar files are usually  ignored)
!gradle-wrapper.jar
### SublimeText template
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a  significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project

# sftp configuration file
sftp-config.json
### Linux template
*~

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*
### Vim template
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist

答案 2 :(得分:0)

Grails 3.x是使用gradle构建的,不再需要用于旧grails版本的许多忽略条目。查看gradle的.gitignore文件,它只忽略'.gradle'目录和'build'目录。它还确保不要忽略包装器jar文件。

答案 3 :(得分:0)

嗯,这完全取决于您的技术之手,如想法或日食以及许多其他此类组合。

因此,您的.gitignore文件将根据您实际赢得的内容而有所不同,并希望存储到回购邮件中。

以下是这样的事情:

  1. 编译后生成的任何内容,例如:插件,类文件和构建工具特定数据等
  2. 任何不属于您的应用程序的东西,只有本地机器和工具用于开发和测试目的,例如.iml文件或特定于想法的文件。 请记住,当我说不是你的应用程序的一部分意味着将成功运行的最小的东西,而不管它可能需要从远程服务器下载某些东西。
  3. 这可能是你的回答!