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.
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 Hooks Setup
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
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!