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即可生效
相关推荐
J不A秃V头A2 小时前
IntelliJ IDEA中设置激活的profile
java·intellij-idea
odng2 小时前
IDEA自己常用的几个快捷方式(自己的习惯)
java·ide·intellij-idea
18号房客3 小时前
macOS开发环境配置与应用开发教程(一)
vscode·macos·visualstudio·eclipse·intellij-idea·phpstorm·visual studio
皮蛋很白4 小时前
Maven 环境变量 MAVEN_HOME 和 M2_HOME 区别以及 IDEA 修改 Maven repository 路径全局
java·maven·intellij-idea
w_312345415 小时前
自定义一个maven骨架 | 最佳实践
java·maven·intellij-idea
dr李四维18 小时前
IntelliJ IDEA 快捷键大全:提升开发效率的利器
java·intellij-idea·键盘·快捷键·快速开发
会说法语的猪1 天前
IDEA使用Alt + Enter快捷键自动接受返回值一直有final修饰的问题处理
java·ide·intellij-idea
music0ant1 天前
Idea 将多个module显示在同一个project
intellij-idea
GoodStudyAndDayDayUp2 天前
IDEA能够从mapper跳转到xml的插件
xml·java·intellij-idea
Anna。。2 天前
Java入门2-idea 第五章:IO流(java.io包中)
java·开发语言·intellij-idea