Skip to main content

Git Recursive Grep

Project description

Git Recursive Grep

PyPI version Downloads

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

pip install git-rg
python3 -m pip install git-rg
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>] [-L <maxline>]

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+)['\"]?" ~/projects -B 2 -A 2

Output seems like this:

image_2024-09-22_18-56-49

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

git_rg-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_rg-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file git_rg-0.2.0.tar.gz.

File metadata

  • Download URL: git_rg-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for git_rg-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4f30707bd0a8454706d3eb0b7612f2f89c4603f0cecfdf96684494b75a8f9368
MD5 f66a342e25563887f459170e4ddb6204
BLAKE2b-256 d3ff9888921a5ffe87a5c28a8bb20f8e432b5a9deeb23d71b3799109bbc0cac5

See more details on using hashes here.

File details

Details for the file git_rg-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: git_rg-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for git_rg-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab6db33947d84e7934d1d8b352444f7bfa3858fe01713768df854927fcbc4a4
MD5 2e5e7185b359a775b687d29cfd57de2f
BLAKE2b-256 32112256c6010f9b7bdf05c12bcc71c661a29a4973be9ea245b94397d33dcfce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page