A utility for recursively searching for files in .git directories using regex.
Project description
README.md
git-rg is a command-line tool for recursively searching for files in Git repositories that contain specific text patterns using regular expressions. It's useful for finding sensitive information like accidentally committed passwords or API keys within .git directories.
Installation
pipx install git-rg
To install latest version from Github:
pipx install git+https://github.com/s3rgeym/git-rg
Usage
git-rg <pattern> [path] [-B <num>] [-A <num>]
Arguments
pattern: Regular expression to search for.path: Path to the directory where the search should begin (default: current directory).-B,--before: Number of lines to show before the match.-A,--after: Number of lines to show after the match.
Example
To search for passwords in all .git files within the current directory and show 2 lines before and after the match:
git-rg "(?i)password\s*=\s*['\"]?(\w+)['\"]?" -B 2 -A
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_rg-0.1.0.tar.gz.
File metadata
- Download URL: git_rg-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ae115934d4fdbf88f9d3da00e468d4a0f189bd1ab183b348f764a0b1837272d
|
|
| MD5 |
ef07fb75b663fbef68319738941c1936
|
|
| BLAKE2b-256 |
b3323adf3ef6f749f47136e82c700f2eca3303f189f85bcf7f2e16d302b34b55
|
File details
Details for the file git_rg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_rg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67d1e2d3d7ae70668009e07d61df697546cbab32579e701569e848889ff81fc0
|
|
| MD5 |
4b0a29ef46db448244aaceeada6e5353
|
|
| BLAKE2b-256 |
bc9774a85def2383384c79b8622e24d9b0430d2c48942c1035344254281ec9bc
|