idea git commit全局ignore配置

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.db

    Folder config file

    Desktop.ini

    Recycle Bin used on file shares

    $RECYCLE.BIN/

    Windows Installer files

    *.cab
    *.msi
    *.msm
    *.msp

    Windows shortcuts

    *.lnk

    OSX System

    .DS_Store
    .AppleDouble
    .LSOverride

    Icon 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.icns

    Directories potentially created on remote AFP share

    .AppleDB
    .AppleDesktop
    Network Trash Folder
    Temporary Items
    .apdisk

    Eclipse

    *.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

    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
    *.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

    JAVA

    *.class

    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*
    #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即可生效
相关推荐
yaosheng_VALVE6 小时前
稀硫酸介质中 V 型球阀的材质选择与选型要点-耀圣
运维·spring cloud·自动化·intellij-idea·材质·1024程序员节
一个松13 小时前
IDEA报包不存在,但实际存在
java·ide·intellij-idea
九转成圣13 小时前
如何在 IntelliJ IDEA 中去掉 Java 方法注释后的空行
java·intellij-idea·idea·intellij idea
zy01010115 小时前
使用 IDEA 创建 Java 项目(二)
java·人工智能·intellij-idea
lcz-200017 小时前
IDEA一键部署SpringBoot项目到服务器
java·spring boot·intellij-idea
Daniel 大东19 小时前
idea 解决缓存损坏问题
java·缓存·intellij-idea
wind瑞19 小时前
IntelliJ IDEA插件开发-代码补全插件入门开发
java·ide·intellij-idea
HappyAcmen19 小时前
IDEA部署AI代写插件
java·人工智能·intellij-idea
阿乾之铭20 小时前
IDEA中创建多模块项目步骤
java·ide·intellij-idea
江梦寻2 天前
解决SLF4J: Class path contains multiple SLF4J bindings问题
java·开发语言·spring boot·后端·spring·intellij-idea·idea