SourceTree and pre commit hook

Khoa Pham
Khoa Pham
Mar 27, 2017 · 1 min read

Pre-commit file works perfectly in terminal, but SourceTree seems to ignore it. I use both terminal and SourceTree, as I also like the visual representation of branches and commits besides all the powerful git commands.

As of SourceTree 2.4.1, it defaults to use Embedded Git 2.8.1, but the hooksPath requires git 2.9+

So all we have to do is to go to SourceTree -> Preferences -> Git and choose Use System Git which lies in /usr/bin/git As of mac Sierra 10.12.3 we have git 2.10.1

Now precommit hooks work in SourceTree

Fantageek

Simple apps that make sense

Khoa Pham

Written by

Khoa Pham

My apps https://onmyway133.github.io/

Fantageek

Fantageek

Simple apps that make sense

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade