An open API service indexing awesome lists of open source software.

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

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` |