Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

When clone in SourceTree, warning: templates not found is shown

maxicho August 14, 2018


First of all, I am on macOS.

This warning is encountered by many users:

In conclusion, the solutions are to use system git or change the git template directory to


I have no problem in cloning my source code (it is just warning and do not block me from cloning). In many times, I just ignored it and finally this warning bites me hard.

I notice that my pre-commit hooks (setup by husky) are not running in my js project. After long time debugging, I find that .git/hooks is missing. And after several trial-and-errors, I find that when cloning via SourceTree, .git/hooks is not being created and it is due to the missing template warning!

By default, the template directory contains hooks, description and info directories. These will be copied to project directory during `git init` or `git clone`. But as template is not found by SourceTree, they are not copied!

It looks like SourceTree assumes template directory is /usr/local/git/share/git-core/templates which is not the case as documented in

Can anyone take a look on this aged problem? It is affecting my team's workflow and obviously asking every team members to set SourceTree config is not one of the best solution.


2 answers

0 votes
Edward Keenan August 25, 2020

I found that the issues was that the .gitconfig file in my home directory wasn't pointing to the location of the templates directory. If you open the .gigconfig file there will be a templatedir property in the intit section

templatedir = some_wrong_path/share/git-core/templates


If you can figure out where the templates actually, probably under one of the sourcetree or git folders, you can change the path. One thing I noticed is that the git version I was using wanted to add its git bath so I just needed.

templatedir = /share/git-core/templates

0 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 14, 2018

Have you tried switching to System Git in Sourcetree? If your setup works on terminal and everything is setup with the system git path, you should switch to using System Git. Navigate to Preference window's Git tab and click on Use System Git button to switch. 

maxicho August 14, 2018

Yes I tried, and it worked (i.e. my hooks directory got created).

What I don't understand is why the embedded git is looking for git template at /usr/local/git/share/git-core/templates (I got this from the warning message in SourceTree) rather than the one documented at 

The default template dir is /usr/share/git-core/templates. If git is installed locally, I guess it should be /usr/local/share/git-core/templates. 

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events