如果我想在gitignore中使用文件怎么办 [英] What if I want to use files in gitignore

查看:71
本文介绍了如果我想在gitignore中使用文件怎么办的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于诸如aws键或密码之类的敏感数据,我将它们放在.gitignore中的文件中,以确保未提交给git.但是,当脚本运行时要使用键时,该怎么办?在运行之前手动在文件中添加关键内容?如果需要詹金斯定期触发该程序怎么办?

For sensitive data such as aws keys or password, I put them to files which is in .gitignore to make sure it is not committed to git. However, when keys are going to be used when scripts are running, what should I do? Manually add key content in a file before running? What if the program need to be triggered periodically by Jenkins?

有人可以帮我吗?

推荐答案

在运行之前手动在文件中添加关键内容吗?

Manually add key content in a file before running?

这是一个普遍的想法:敏感信息不应位于Git存储库中,而应位于外部参考文件(例如保险柜)中.

That is the general idea: sensitive information should not be in a Git repo, but in an external referential, like a Vault.

一旦您拥有一个能够从库中提取信息的脚本,您就可以在结帐时通过 git内容过滤器自动调用该脚本驱动程序.

Once you have a script able to extract that information from a vault, you could call that script automatically on checkout through a git content filter driver.

这篇关于如果我想在gitignore中使用文件怎么办的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆