All Projects → ezekg → Git Hound

ezekg / Git Hound

Licence: mit
Git plugin that prevents sensitive data from being committed.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Git Hound

Xo
Command line utility that composes regular expression matches.
Stars: ✭ 184 (-31.6%)
Mutual labels:  cli, regular-expression
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+1701.86%)
Mutual labels:  cli, regular-expression
Fsociety
A Modular Penetration Testing Framework
Stars: ✭ 259 (-3.72%)
Mutual labels:  cli
Frick
frick - aka the first debugger built on top of frida
Stars: ✭ 267 (-0.74%)
Mutual labels:  cli
Github cli
GitHub on your command line. Use your terminal, not the browser.
Stars: ✭ 263 (-2.23%)
Mutual labels:  cli
Perfops Cli
A simple command line tool to interact with hundreds of servers around the world.
Stars: ✭ 263 (-2.23%)
Mutual labels:  cli
Cliffy
NodeJS Framework for Interactive CLIs
Stars: ✭ 263 (-2.23%)
Mutual labels:  cli
Nord Gnome Terminal
An arctic, north-bluish clean and elegant GNOME Terminal color theme.
Stars: ✭ 258 (-4.09%)
Mutual labels:  cli
Gitmoji Cli
This project provides an easy solution for using gitmoji from your command line. Gitmoji-cli solves the hassle of searching through the gitmoji list. Includes a bunch of options you can play with! 🎉
Stars: ✭ 3,514 (+1206.32%)
Mutual labels:  cli
Imessage
💬 Send iMessages from command-line
Stars: ✭ 261 (-2.97%)
Mutual labels:  cli
Picocli
Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
Stars: ✭ 3,286 (+1121.56%)
Mutual labels:  cli
Terminus
The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform
Stars: ✭ 263 (-2.23%)
Mutual labels:  cli
Clasp
🔗 Command Line Apps Script Projects
Stars: ✭ 3,232 (+1101.49%)
Mutual labels:  cli
Pygogo
A Python logging library with superpowers
Stars: ✭ 265 (-1.49%)
Mutual labels:  cli
Ddh
A fast duplicate file finder
Stars: ✭ 262 (-2.6%)
Mutual labels:  cli
Td
Your todo list in your terminal
Stars: ✭ 265 (-1.49%)
Mutual labels:  cli
I18next Scanner
Scan your code, extract translation keys/values, and merge them into i18n resource files.
Stars: ✭ 259 (-3.72%)
Mutual labels:  cli
Sqawk
Like Awk but with SQL and table joins
Stars: ✭ 263 (-2.23%)
Mutual labels:  cli
Fastify Cli
Run a Fastify application with one command!
Stars: ✭ 260 (-3.35%)
Mutual labels:  cli
Irs
🎸 🎶 A music downloader that understands your metadata needs.
Stars: ✭ 268 (-0.37%)
Mutual labels:  cli

Git Hound

Travis Code Climate GoDoc

Hound is a Git plugin that helps prevent sensitive data from being committed into a repository by sniffing potential commits against PCRE regular expressions.

How does it work?

Upon commit, it runs the output of git diff -U0 --staged through the Hound, which matches every added or modified line against your provided list of regular expressions from a local .githound.yml file.

Installation

To install Hound, please use go get. If you don't have Go installed, get it here. If you would like to grab a precompiled binary, head over to the releases page. The precompiled Hound binaries have no external dependencies.

go get github.com/ezekg/git-hound

If you're on macOS, you can also install using Homebrew:

brew install git-hound

Compiling

To compile for your operating system, simply run the following from the root of the project directory:

go install

To compile for all platforms using gox, run the following:

gox

Usage

git-hound [<opts>] commit [...]
git-hound [<opts>] sniff [<commit>]

Commit

Sniff changes before committing.

# Sniff changes since last commit and pass to git-commit when clean
git hound commit …

Sniff

You can optionally pass a commit hash or manually pipe a diff for the Hound to sniff.

# Sniff changes since last commit
git hound sniff HEAD

# Sniff entire codebase
git hound sniff

# Sniff entire repo history
git log -p | git hound sniff

Option flags

Flag Type Default Usage
-no-color bool false Disable color output
-config=file string .githound.yml Hound config file
-bin=file string git Executable binary to use for git command

Example .githound.yml

# Output warning on match but continue
warn:
  - '(?i)user(name)?\W*[:=,]\W*.+$'
  - '\/Users\/\w+\/'
# Fail immediately upon match
fail:
  - '[''"](?!.*[\s])(?=.*[A-Za-z])(?=.*[0-9])(?=.*['"]'
  - '(?i)db_(user(name)?|pass(word)?|name)\W*[:=,]\W*.+$'
  - '(?i)pass(word)?\W*[:=,]\W*.+$'
# Skip on matched filename
skip:
  - '\.example$'
  - '\.sample$'