etckeeper on custom directory
It is right there in the man page.
- Create a directory /foo
- Initialize with etckeeper:
etckeeper init -d /foo
- Commit apply commits to the directory:
etckeeper commit -d /foo 'message'
But as ErikA mentioned you could just as easily use git or your favorite DVCS directly.
Etckeeper is merely a wrapper for mercurial or git. It provides some nice hooks into package management tools to automatically grab a commit after updates, and optionally on a schedule. This additional functionality is most likely not needed outside of /etc.
Depending on your needs, I'd just use vanilla git (or any other version control tool you're familiar with). If needed, schedule regular commits via cron or as part of your application deployment process.
If you don't want to all the time provide "-d" you can put line:
ETCKEEPER_DIR=/opt
into /etc/etckeeper/etckeeper.conf.
It's not in man, but it can be inferred from etckeeper script.