See a lovely color swatch in your terminal every time you author a commit. The hexadecimal color comes from the first six characters in your commit ID. Here's what it looks like:
For a live demo and some background on the project, watch this 5-minute lunch-and-learn video.
Commit colors is written in Go, and is usable on Mac, Windows, and Linux.
Note: this readme contains instructions for commit-colors 2.0+. commit-colors 1.0 was written in JavaScript and distributed on npm. For instructions on that version of the project, see the v1 README.
Via Homebrew
brew tap sparkbox/commit-colors
brew install commit-colors
Via Direct Download
- Browse to the list of releases, and download the package that corresponds to your system (Mac, Windows or Linux).
- Move the executable to a location on your PATH (like
/usr/local/bin
, for example).
Once installed, you can do a quick test in the terminal:
commit-colors 123ADD5db8d67ba9621eb5d6765ffdef4c24077a
Option 1: Create the hook by hand
Copy/paste the following text into a post-commit hook:
#!/bin/bash
commit-colors $(git rev-parse HEAD)
In other words, put the above code in a file named post-commit
at the location .git/hooks/post-commit
in your git project of choice. Make sure this file is executable. If you want this hook to run on all your repos, see how to do that here.
Option 2: Use a Git Hooks manager
See this list of tools for managing git hooks.
Whatever tool you use, this is the command you'll want it to run: commit-colors $(git rev-parse HEAD)
- Create a new tag, and push it up to Github:
git tag -a 2.0.0 -m "Version 2 release"
git push origin 2.0.0
- The Github Action handles the rest!
- The action publishes a Github release and a homebrew update.
- Additional publishing settings can be found in
goreleaser.yml