I have gitolite3 up and running. When I create an entry on conf/gitolite.conf with a new repo, gitolite3 creates a brand new repo.
Is it possible to make it clone from an existing repo, instead of creating a new one?
I have gitolite3 up and running. When I create an entry on conf/gitolite.conf with a new repo, gitolite3 creates a brand new repo.
Is it possible to make it clone from an existing repo, instead of creating a new one?
The easiest option (without having to patch gitolite itself) would be to use a template directory (set for instance with the environment variable $GIT_TEMPLATE_DIR
):
The template directory contains files and directories that will be copied to the
$GIT_DIR
after it is created.
But that doesn't mean commits from an existing repo, only some hooks and config copied to the new repo from the template directory.
However, as mentioned in "git hooks : is there a clone hook?", if your template directory includes a post-checkout hook, this hook is triggered. I am not sure however if it would be triggered when creating a bare repo though. But if it is, that would be your opportunity to fetch the history of an existing other repo.
If it is not, and no other hooks are triggers right a git init --bare (which is what gitolite does in Store.pm#new_repos
, then you would need to patch that method in order to fetch another repo into the empty bare repo newly created.