Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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


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
Manju Atlassian Team Aug 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. 

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. 

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

3,334 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you