gitignore常用配置

toc

java版

以下是.gitignore的常用配置,需要的话,可以自己再添加一些啊。

python 复制代码
.mymetadata
.checkstyle
.classpath
.project
.class
.war
.zip
.rar
.idea
*.iml
.settings/*
/indexes/*
/target/*
/src/main/webapp/WEB-INF/classes/*
/src/main/webapp/userfiles/*
/target/
/target
mobile.sql

官网自带的代码是:

bash 复制代码
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**

python版

python 复制代码
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# 1. 忽略整个 .idea 目录
.idea/

# 2. 强制不忽略(放行)团队需要共享的核心配置文件
!.idea/misc.xml
!.idea/modules.xml
!.idea/vcs.xml
!.idea/inspectionProfiles/

STS

.apt_generated

.classpath

.factorypath

.project

.settings

.springBeans

.sts4-cache

IntelliJ IDEA

.idea

*.iws

*.iml

*.ipr

NetBeans

/nbproject/private/

/nbbuild/

/dist/

/nbdist/

/.nb-gradle/

build/

VS Code

.vscode/

语法解释

虽然一直在用,但是并不是很清楚。

.(点号)表示什么意思

.(点号) 表示按扩展名匹配

实战忽略application-dkh.yml

试了几种通配符方法不好用,干脆直接全路径,实测有效。

startup/src/main/resources/application-dkh.yml

前提:文件未被add,如果添加了那么ignore应该是无效的。

相关推荐
大树911 小时前
把 Java 项目从手动 SCP 升级到 Gitee Go 自动部署:一份踩坑实录
java·golang·gitee
LayZhangStrive1 天前
Git - 使用IDEA和git上传本地项目到Gitee远程仓库
git·gitee·idea
菠萝加点糖1 天前
Android applicationIdSuffix 详解
android·gitee·kotlin
扶苏10022 天前
gitee码云删除仓库教程
gitee
水巷石子2 天前
目前最新版本PicGo上传图片到gitee仓库具体配置
gitee·上传·typora·picgo·图片
事圆则缓4 天前
Kotlin 语法入门与快速上手
gitee
lingran__5 天前
Git 完全指南(三):远程仓库与标签管理
开发语言·git·gitee·ssh·团队协作·远程仓库·分布式版本控制
心平气和量大福大7 天前
android-控件-搜索框SearchView
android·gitee
心平气和量大福大7 天前
android-控件-多选框CheckBox
android·gitee
陈行恩7 天前
本地项目推送GITEE
gitee