git-secrets防止向 git 仓库提交敏感信息

联合创作 · 2023-10-01 05:56

git-secrets 扫描 commits、commit messages 和 --no-ff merges,以防止向你的 git 仓库添加 secrets。如果一个commits、commit messages 和 --no-ff merges 历史中的任何 commit 与你配置的禁止正则表达式模式之一相匹配,那么该 commit 将被拒绝。

git secrets --scan [-r|--recursive] [--cached] [--no-index] [--untracked] [<files>...] 
git secrets --scan-history 
git secrets --install [-f|--force] [<target-directory>] 
git secrets --list [--global] 
git secrets --add [-a|--allowed] [-l|--literal] [--global ] <pattern> 
git secrets --add-provider [--global] <command> [arguments...] 
git secrets --register-aws [--global] 
git secrets --aws-provider [<credentials-file> ]

git-secrets 必须放在你的 PATH 中的某个地方,以便在运行 git secrets 时被 git 选中

浏览 11
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报