First of all, I am on macOS.
This warning is encountered by many users:
https://community.atlassian.com/t5/Git-questions/About-git-path-for-Sourcetree/qaq-p/186483
https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-git-cloning-warning-templates-not-found/qaq-p/253348
In conclusion, the solutions are to use system git or change the git template directory to
/Applications/SourceTree.app/Contents/Resources/git_local/share/git-core/templates
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 https://git-scm.com/docs/git-init#_template_directory
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.