Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: templates not found /usr/local/git/share/git-core/templates

I get this error warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository this link, this link, and this link I tried this method and I just waiting more than 20 minutes but repo doesn't clone. I use source-tree and OS X El Capitan. How can I fix it?

like image 920
Alexander Khitev Avatar asked Jan 19 '16 13:01

Alexander Khitev


People also ask

What is git template directory?

The template directory contains files and directories that will be copied to the $GIT_DIR after it is created. The files which are copied from the template directory are placed in your GIT_DIR which defaults to the . git directory under your repo's root directory.

What is git template?

Git Template is a replacement for the default directory that gets copied each time you create or clone a git repository. That's right, every time you create or clone a git repository, some files get copied in your . git directory. These files mostly consist of example hooks you may change and adapt to meet your needs.

What happens when you git clone?

The Git clone command will create a new local directory for the repository, copy all the contents of the specified repository, create the remote tracked branches, and checkout an initial branch locally. By default, Git clone will create a reference to the remote repository called origin .


2 Answers

Create a templates folder.

In your case, it should be: mkdir /usr/local/git/share/git-core/templates

like image 113
dpaluy Avatar answered Sep 19 '22 04:09

dpaluy


I was also getting same error warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository then i found solution which solved my issue. I Added the [init] section to .gitconfig in 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

Hope it will help you!.

like image 29
Anand Halawai Avatar answered Sep 21 '22 04:09

Anand Halawai