Lion King Commit

Have you guys ever wanted to play the Lion King song when you commit files in git?

Well I know I did. I’m not sure about the rest of you but in my house my kids and I constantly sing the start of the song anytime we do something awesome.

So feel free to do this on your machine or maybe your buddies as a joke.

I’m on a mac so I did it for that. You’ll need brew installed.

The Commands

## install xquarts for mplayer
$ brew cask install xquartz
$ brew install mplayer

$ mkdir ~/.git/hooks
$ cd ~/.git/hooks

You need to create a file called post-commit in the ~/.git/hooks directory. mplayer should play the file in the background so you don’t have to wait for the song to finish and hang git commit up.

mplayer -msglevel all=-1 ~/.git/hooks/lionking.mp3 &

Make post-commit file executable and add it to git config.

$ chmod +x post-commit
$ git config --global core.hooksPath ~/.git/hooks

The next time you commit a file it should play the song.

Other Music

You can download the lionking.mp3 file here

I have some other great sound files to try:


Have fun :P FU Rona!