idea 全局ignore配置
在开发时,提交开发代码到git,需要剔除一些不需要提交的文件。那么可以配置一个全局ignore文件。
配置方法
-
新建一个git.ignore文件,将配置写好。
DIY
target/
svn
.svn/
Linux System
*~
KDE directory preferences
.directory
Linux trash folder which might appear on any partition or disk
.Trash-*
Windows System
Windows image file caches
Thumbs.db
ehthumbs.dbFolder config file
Desktop.ini
Recycle Bin used on file shares
$RECYCLE.BIN/
Windows Installer files
*.cab
*.msi
*.msm
*.mspWindows shortcuts
*.lnk
OSX System
.DS_Store
.AppleDouble
.LSOverrideIcon must end with two \r
Icon
Thumbnails
._*
Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icnsDirectories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdiskEclipse
*.pydevproject
.metadata
.gradle
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpathEclipse Core
.project
External tool builders
.externalToolBuilders/
Locally stored "Eclipse launch configurations"
*.launch
CDT-specific
.cproject
JDT-specific (Eclipse Java Development Tools)
.classpath
Java annotation processor (APT)
.factorypath
PDT-specific
.buildpath
sbteclipse plugin
.target
TeXlipse plugin
.texlipse
JetBrains
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
*.iwsPlugin-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.propertiesJAVA
*.class
Mobile Tools for Java (J2ME)
.mtj.tmp/
Package Files
*.jar
*.war
*.earvirtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#Maven
target/
**/target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
logs/ -
找到git的全局配置文件,将该新建的文件配置到其中。
我的是在C:\Users\Windows,文件名.gitconfig
[user]
name = xxx
email = xxx@163.com
# 增加以下内容,排除文件
[core]
excludesfile = C:/Users/Windows/git.ignore
- idea中配置对应的git即可生效