Hi,
I got a problem when I want to clone a repository from bitbucket using sourceTree in MAC OS. It seems sourcetree default my git PATH in /usr/local/git while my git is exactly installed somewhere else(installed with brew) which makes the warning below when cloning and the cloning can't be finished.
warning: templates not found /usr/local/git/share/git-core/templates
How could I fix this problem! Much thanks!
I had the same "Template not found" error with a fresh installation of SourceTree 2.0.5.2 in Yosemite 10.10.3 with Xcode 6.3.1 installed. To investigate the problem I opened the SourceTree Preferences and went to the Git Preferences Panel. There the panel was reporting that I was using the embedded version, I switched to "System Git" and then switched back to "Embedded Git", and it fixed the problem.
Seems like there may be a glitch in SourceTree, I hope my findings helps anyone who is having the same problem.
It works after I switchted to 'System Git' .
alough I downloaded and installed git from https://git-scm.com/downloads
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can confirm this is a problem with the embedded git version (v2.8.1). Switching to System Git (v2.10.1) fixed the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I had this problem I was l already using system git, but switching to the embedded one fixed it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was bugging me for ages, although it didn't seem to affect the speed with which I could clone repos. Anyway, I fixed it by adding the [init] section to .gitconfig in my home directory, so that it looked at SourceTree's git templates directory when cloning a repo:
[init]
templatedir = /Applications/SourceTree.app/Contents/Resources/git_local/share/git-core/templates
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This seems to have worked. I still can't clone a submodule from Bitbucket due to a different error involving passwords. But the templates portion of the error went away thanks to this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! This worked for me too!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it is Windows, try it with
[init]
templatedir = C:/Program Files/Git/mingw64/share/git-core/templates
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or
templatedir = C:/Users/[name]/AppData/Local/Programs/Git/mingw64/share/git-core/templates
Depends on where the git is. It's strange the git is in different places with default installation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Segal, your workaround was perfectly worked for me.
With Xcode 6.3.1, Source tree 2.0.5.2 and Yosemite 10.10.3
Thank you for posting this.
Steps:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Norlan,
What happens when you type in "which git" at the terminal?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
/usr/local/homebrew/bin/git
this should be a soft link organized by the brew,the actual home path of the git should be /usr/local/homebrew/Cellar/git/1.8.5.2 where I can find the share/git-core/templates
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is sourcetree configured to use embedded or system git?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for helping! It's just a stupid mistake. Sourcetree can works normally through this warning, but I need to wait for nearly an hour to finish the cloning for the project is too large. Embarrassing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Norlan, I'm being silly. SourceTree runs in its own environment entirely. Whatever is on your PATH won't be used by SourceTree. I'm assuming based on what you've said that you're using system Git in SourceTree and have specified /usr/local/git as the Git path. Check it out by going to Preferences > Git and seeing what it says there.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be helpful if the "accepted" answer here was an actual answer, instead of a series of questions and answers. If I understand correctly, there isn't an actual solution for the problem (a warning when running git actions in sourcetree).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Resnick Did any of the other answers work for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since it's only a warning, I haven't done much further investigations. I did change the git used by sourcetree from internal to what I have installed on my machine (2.5) and I haven't seen any further warnings. BTW, I wanted to reply to you here yesterday but I couldn't because I didn't have enough karma points. This stackoverflow platform looks nice, but it looks like it isn't being used very well to help answer questions about the product (sourcetree). This is the first result when googling the warning output by sourcetree; it would have been great to find an actual answer here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found away around it by using iTerm to clone the Repo. I suspect it has to do with the Size of the Repo and SourceTree not being able to cope.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to get this all in one post: if you're seeing this on Windows, do the following:
[init] templatedir = C:/Program Files/Git/mingw64/share/git-core/templates
[init] templatedir = C:/Users/USERNAME/AppData/Local/Atlassian/SourceTree/git_local/mingw32/share/git-core/templates
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked for me. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This happened to me on a 1gig+ repo. Shame the progress bar doesn't show any activity in that time and it looks like it's hung
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.