- Our template directory is ready, and we can use it, as described earlier, as a command-line option, an environment variable or, as in this example, to be set as a configuration:
$ git config --global init.templatedir ~/.git_template
- Now, all Git repositories we create using init or clone will have the default files of the template directory. We can test whether it works by creating a new repository as follows:
$ git init template-example $ cd template-example
- Let's try to create a .txt file and see what git status tells us. It should be ignored by the exclude file from the template directory:
$ echo "this is the readme file" > README.txt $ git status
The exclude file worked! You can put in the file endings yourself, ...