Posts

Showing posts from 2023

Add a fun Mario Bros sound on git commit

Image
I wanted to make my own day a little more fun so I added a Mario Bro's vine sound on all of my repos when I make commits. I'm sure there are many ways to go about it but here is how I did it on a Mac.   *Note this way works only when you do not have a local post-commit file in your repo if you need both global and local it looks like the steps are a little trickier see this   stack overflow  for more details.  You could always use a different git hook as well.  1. Enable git templates: git config --global init.templatedir '~/.git-templates' 2. Create a directory to hold the global hooks: mkdir -p ~/.git-templates/hooks 4. Add the hook file .   (post-commit or whatever git hook file you want) touch  ~/.git-templates/hooks/post-commit *Important do not add the .sh file type or it will run 5. Make sure the hook is executable. chmod a+x ~/.git-templates/hooks/post-commit 6. Add your sound file to the global hooks folder (~.git-template/hook...