保护Git中的敏感信息 [英] Protecting sensitive information in Git
本文介绍了保护Git中的敏感信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ b
- 用伪数据填充配置文件,提交更改并推送至GitHub 在跟踪的文件中:
git update-index --assume-unchanged config-file
- 使用敏感信息填充配置文件
Assume I have a project I'm working on that is a blog. In this blog I have a config file with sensitive information in it. When I decide to push this project to Github, I want the config file filled with example data instead of my sensitive data. What is the best, and most widely used, method of achieving this?
解决方案
One possible approach is:
- fill the config file with dummy data, commit changes and push to GitHub
configure git to ignore changes in tracked file:
git update-index --assume-unchanged config-file
- fill the config file with sensitive information
这篇关于保护Git中的敏感信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文