SOURCE: tpope's blog
- Say this directory is
~/git_template. Run the following commands:
git config --global init.templatedir '~/git_template'
Make sure the hook files at ./hooks/ are executable.
-
Perform
git initinside an existing repository to copy the hooks at./hooks/intorepo/.git/hooks/. -
Now any new repositories we create or clone will be immediately indexed with Ctags (at
repo/.git/tags) and set up to re-index every time we check out, commit, merge, or rebase. Basically, we’ll never have to manually run Ctags on a Git repository again. -
If vim-fugitive is installed,
repo/.git/tagsis already added into thetagsoption; thus, we don't even have to explicitly add the location of the tags file in Vim!