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应该是无效的。

相关推荐
效能革命笔记2 天前
Gitee Team 如何支撑关键领域行业 DevSecOps 落地?
gitee
故渊at3 天前
第二板块:Android 四大组件标准化学理 | 第八篇:Service 后台执行实体与优先级
android·gitee·service·前台服务·后台服务
故渊at3 天前
第二板块:Android 四大组件标准化学理 | 第九篇:BroadcastReceiver 事件分发与有序广播
android·gitee·broadcast·广播·动态注册·静态注册
毛豆的毛豆Y4 天前
新上架!给 Gitee 用户做了个工具:CopoGit
gitee
hashiqimiya4 天前
每日android布局xml文件
android·xml·gitee
效能革命笔记4 天前
Gitee DevSecOps 军工软件工厂实践:以智能版本管理破解跨院所协同难题
gitee
QiLinkOS5 天前
合肥气链科技有限公司本质总结
c++·科技·算法·gitee·开源
tealcwu6 天前
【Git 实战】三类方案实现一键推送多端仓库(Gitee & GitHub)
git·gitee·github
yurenpai(27届找实习中)6 天前
IntelliJ IDEA 项目推送到 Gitee 完整教程
gitee
晓说前端7 天前
本地项目如何上传到远程仓库?(以Gitee为例,附GitHub说明)
gitee·github