<commit_before>.\" Man page generated from reStructuredText.
.
.TH GIT-SECRETS  "" "" ""
.SH NAME
git-secrets \- 
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
Prevents you from committing passwords and other sensitive information to a
git repository.
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
git secrets \-\-scan [\-r|\-\-recursive] [\-\-cached] [\-\-no\-index] [\-\-untracked] [<files>...]
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>]
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
\fBgit\-secrets\fP scans commits, commit messages, and \fB\-\-no\-ff\fP merges to
prevent adding secrets into your git repositories. If a commit,
commit message, or any commit in a \fB\-\-no\-ff\fP merge history matches one of
your configured prohibited regular expression patterns, then the commit is
rejected.
.SS Installing git\-secrets
.sp
\fBgit\-secrets\fP must be placed somewhere in your PATH so that it is picked up
by \fBgit\fP when running \fBgit secrets\fP\&. You can use \fBinstall\fP target of the
provided Makefile to install \fBgit secrets\fP and the man page. You can
customize the install path using the PREFIX and MANPREFIX variables.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
make install
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, installing with Homebrew (for OS X users).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
brew install git\-secrets
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBWARNING:\fP
.INDENT 0.0
.INDENT 3.5
You\(aqre not done yet! You MUST install the git hooks for every repo that
you wish to use with \fBgit secrets \-\-install\fP\&.
.UNINDENT
.UNINDENT
.sp
Here\(aqs a quick example of how to ensure a git repository is scanned for secrets
on each commit:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cd /path/to/my/repo
git secrets \-\-install
git secrets \-\-register\-aws
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.SS Operation Modes
.sp
Each of these options must appear first on the command line.
.INDENT 0.0
.TP
.B \fB\-\-install\fP
Installs hooks for a repository. Once the hooks are installed for a git
repository, commits and non\-ff merges for that repository will be prevented
from committing secrets.
.TP
.B \fB\-\-scan\fP
Scans one or more files for secrets. When a file contains a secret, the
matched text from the file being scanned will be written to stdout and the
script will exit with a non\-zero RC. Each matched line will be written with
the name of the file that matched, a colon, the line number that matched,
a colon, and then the line of text that matched. If no files are provided,
all files returned by \fBgit ls\-files\fP are scanned.
.TP<commit_msg>Updating readme<commit_after>.\" Man page generated from reStructuredText.
.
.TH GIT-SECRETS  "" "" ""
.SH NAME
git-secrets \- 
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
Prevents you from committing passwords and other sensitive information to a
git repository.
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
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>]
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
\fBgit\-secrets\fP scans commits, commit messages, and \fB\-\-no\-ff\fP merges to
prevent adding secrets into your git repositories. If a commit,
commit message, or any commit in a \fB\-\-no\-ff\fP merge history matches one of
your configured prohibited regular expression patterns, then the commit is
rejected.
.SS Installing git\-secrets
.sp
\fBgit\-secrets\fP must be placed somewhere in your PATH so that it is picked up
by \fBgit\fP when running \fBgit secrets\fP\&. You can use \fBinstall\fP target of the
provided Makefile to install \fBgit secrets\fP and the man page. You can
customize the install path using the PREFIX and MANPREFIX variables.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
make install
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Or, installing with Homebrew (for OS X users).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
brew install git\-secrets
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBWARNING:\fP
.INDENT 0.0
.INDENT 3.5
You\(aqre not done yet! You MUST install the git hooks for every repo that
you wish to use with \fBgit secrets \-\-install\fP\&.
.UNINDENT
.UNINDENT
.sp
Here\(aqs a quick example of how to ensure a git repository is scanned for secrets
on each commit:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
cd /path/to/my/repo
git secrets \-\-install
git secrets \-\-register\-aws
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.SS Operation Modes
.sp
Each of these options must appear first on the command line.
.INDENT 0.0
.TP
.B \fB\-\-install\fP
Installs hooks for a repository. Once the hooks are installed for a git
repository, commits and non\-ff merges for that repository will be prevented
from committing secrets.
.TP
.B \fB\-\-scan\fP
Scans one or more files for secrets. When a file contains a secret, the
matched text from the file being scanned will be written to stdout and the
script will exit with a non\-zero RC. Each matched line will be written with
the name of the file that matched, a colon, the line number that matched,
a colon, and then the line of text that matched. If no files are provided,
all files returned by \fBgit ls\-files\fP are scanned.
.TP
.B \fB\-\-scan\-history\fP
Scans repository including all revisions. When a file contains a secret, the
matched text from the file being scanned will be written to stdout and the
script will exit with a non\-zero RC. Each matched line will be written with
the name of the file that matched, a colon, the line number that matched,
a colon, and then the line of text that matched.
.TP
{'fraction_non_alphanumeric': 0.13735890112879098, 'fraction_numerical': 0.013327893376852985, 'mean_word_length': 3.0832870627429205, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6907430', 'n_tokens_mistral': 2737, 'n_tokens_neox': 2591, 'n_words': 994}