https://github.com/kornelijus/grug
🔍 Grep Recursive Utility for Git
https://github.com/kornelijus/grug
bash cli git grep
Last synced: about 2 months ago
JSON representation
🔍 Grep Recursive Utility for Git
- Host: GitHub
- URL: https://github.com/kornelijus/grug
- Owner: Kornelijus
- License: apache-2.0
- Created: 2024-08-14T18:13:02.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T20:40:37.000Z (almost 2 years ago)
- Last Synced: 2025-04-01T10:55:03.042Z (over 1 year ago)
- Topics: bash, cli, git, grep
- Language: Shell
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grug
**G**rep **R**ecursive **U**tility for **G**it
Simple script to search through the main branches of all of your git repositories locally using `git grep`.
It will periodically run `git fetch` before searching to ensure results are (kinda) up to date.
Shout out to everyone who can't afford GitLab Enterprise Edition :skull:
# Installation
```sh
# Clone repo and navigate to script dir
git clone https://github.com/Kornelijus/grug.git
cd grug/bin
# Add script to your PATH
# bash
echo "export PATH=\$PATH:$(pwd)" >> ~/.bashrc
source ~/.bashrc
# zsh
echo "export PATH=\$PATH:$(pwd)" >> ~/.zshrc
source ~/.zshrc
```
# Configuration
| Environment Variable | Description | Default Value |
| -------------------------- | ---------------------------------------------------------- | ----------------- |
| `GRUG_ROOT` | Path to directory where your git repositories are located. | Current directory |
| `GRUG_DEFAULT_BRANCH` | Default branch to search through. | `master` |
| `GRUG_FETCH_INTERVAL_MINS` | How often `git fetch` should be run on the main branches. | `60` |