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.1.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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: git_rg-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5323e127396cac91673c4d8ace41303520f1bb5f8a5a653df82db28bf9bab6a8
MD5 c8970312a5b1b2f40a8b8d95ab91b03c
BLAKE2b-256 0425bdda7256bc3ce0f75e181d72d800c706c604299b105fb71257ca3d1c9802

See more details on using hashes here.

File details

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

File metadata

  • Download URL: git_rg-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db06ae0ea694bc331bf487fa9b07a17bdbcce8cac086fbd3c080d4dc4754a899
MD5 f5406bba86ae92bc43b91d2bfba102d2
BLAKE2b-256 19918f58667c3efce1b351de3c42916a55b30a47fd151f683f5d0d647e232a71

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