Play an audio clip of your choice every time you run git push or git pull. macOS only.
Once set up, every git push and git pull from any repo, any shell, any IDE will trigger the audio.
brew install kelvinxiao01/devtag/devtagIf this is your first time tapping the repo, Homebrew will do that automatically. To tap manually:
brew tap kelvinxiao01/devtag
brew install devtagTwo commands and you're done.
1. Pick the audio file to play:
devtag set /path/to/your/audio.mp3Supported formats are whatever macOS's afplay accepts: .mp3, .wav, .aiff, .m4a, .aac, .caf, .au, Apple Lossless. (Not supported: FLAC, OGG, OPUS.)
Try it with a built-in system sound to sanity-check:
devtag set /System/Library/Sounds/Glass.aiff
devtag playOptionally, give push and pull different sounds. An event without its own sound falls back to the default from devtag set <path>:
devtag set push /System/Library/Sounds/Hero.aiff
devtag set pull /System/Library/Sounds/Submarine.aiff
devtag play push
devtag play pull2. Wire up the global git hooks:
devtag installThat's it. Try git push or git pull in any repo with a remote — audio should play as the push starts or the pull completes.
| Command | What it does |
|---|---|
devtag set <path> |
Save the default audio file, played on both push and pull. |
devtag set push <path> |
Save an audio file played only on git push. |
devtag set pull <path> |
Save an audio file played only on git pull. |
devtag get |
Print the currently configured audio paths. |
devtag play [push|pull] |
Play the configured audio (also used internally by the git hooks). |
devtag install |
Install the global git hooks (pre-push, post-merge, post-rewrite). |
devtag install --force |
Overwrite an existing core.hooksPath setting. |
devtag uninstall |
Remove the hooks and unset core.hooksPath. |
devtag --help |
Show usage. |
devtag install does two things:
- Writes hook scripts to
~/.devtag/hooks/:pre-push— fires ongit push.post-merge— fires after agit pull(orgit merge) that brings in changes.post-rewrite— fires after agit pull --rebase(it ignorescommit --amend).
- Runs
git config --global core.hooksPath ~/.devtag/hooksso git uses that directory for hooks in every repo on the machine.
Each hook runs devtag play in the background and immediately exits 0, so audio never delays or aborts your push or pull.
Note: git has no pull-specific hook, so post-merge/post-rewrite are the closest fit. A pull that's already up to date plays nothing, and a local git merge or git rebase that changes anything also plays the sound.
While devtag is installed, git uses ~/.devtag/hooks/ for hooks instead of each repo's .git/hooks/. If you (or tools like Husky, pre-commit, lefthook) rely on per-repo hooks, those will not fire.
To check whether you have any per-repo hooks that would be silenced, scan your workspace:
find ~/Code ~/projects -maxdepth 6 -type d -name hooks -path "*/.git/hooks" 2>/dev/null \
| while read d; do
files=$(ls "$d" 2>/dev/null | grep -v '\.sample$' || true)
[ -n "$files" ] && { echo "REPO: $(dirname $(dirname $d))"; echo "$files" | sed 's/^/ /'; }
doneSwap ~/Code ~/projects for wherever you keep your repos. Anything that prints is a real hook that devtag install would silence.
If devtag install detects you already have core.hooksPath set to something else, it refuses to overwrite unless you pass --force.
Order matters — run devtag uninstall before brew uninstall, otherwise the hook and core.hooksPath setting get left behind.
devtag uninstall
brew uninstall devtagOptionally:
brew untap kelvinxiao01/devtag # stop pulling formula updates
rm -rf ~/.devtag # remove the saved audio-path configIf you uninstalled in the wrong order, clean up by hand:
git config --global --unset core.hooksPath
rm -rf ~/.devtagMIT — see LICENSE.