如何让本地的敏感配置文件不上传到git仓库

如何防止本地的配置文件上传到git仓库

为了防止将一些敏感的配置文件(api key等)和项目一块上传到git我们可以在.gitignore文件中写入配置

CUSTOM

application-local.yml

然后创建一个新的yml application-local.yml 写入 敏感信息。需要注意的 是application.yml

要设置,否知无法生效

spring:

profiles:

active: local

完成后 链接到仓库的 idea 的项目文件会显示为黄色:

相关推荐
Elasticsearch1 天前
如何通过 Claude Code 来写入 CSV 数据到 Elasticsearch
elasticsearch
深海鱼在掘金2 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
大志哥1233 天前
ES和Logstash日志链路系统上线后遭遇切片爆炸(解决)
大数据·elasticsearch
TableRow3 天前
参数化搜索的实现原理:从多维索引到查询优化
elasticsearch·全文检索
noravinsc3 天前
关于Git Flow
git
蜜獾云3 天前
在Git中配置用户名和密码
git
scx_link3 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
醉颜凉3 天前
Elasticsearch高性能优化:Bulk API大规模数据导入性能调优全攻略
elasticsearch·性能优化·jenkins
Ysouy3 天前
Spring Data Elasticsearch 全流程学习教程
java·spring·elasticsearch
沪飘大军3 天前
goldRush-专门分析黄金的投资理财agent
java·开发语言·elasticsearch