leafwiki icon indicating copy to clipboard operation
leafwiki copied to clipboard

Git folder to work in

Open jochumdev opened this issue 3 months ago • 4 comments

Problem / use case

Currently git backup syncs with the / of a git repository, I wish to specify a working directory inside that repo to use a monorepo for code and docs.

Proposed behavior

Add an environment variable GIT_BACKUP_PATH which allows use to specify the relative path inside the repo to work in with root and assets in there.

Is this ready to be implemented, or does it need discussion first?

Maybe a discussion, not sure.

jochumdev avatar Aug 13 '26 08:08 jochumdev

Would a LEAFWIKI_GIT_BACKUP_PATH (e.g. docs/wiki) that makes the local backup repo root $DATA/.git-backup// with oot/ and ssets/ nested underneath work for your monorepo setup? Happy to pick this up once the preferred layout is confirmed.

richardmilles avatar Aug 14 '26 07:08 richardmilles

Yes, that would work for me.

jochumdev avatar Aug 14 '26 08:08 jochumdev

Proposed approach: rather than copying root/+assets/ into a subdir each backup cycle, commit them straight into the configured prefix via git plumbing. build the tree objects, splice under , write the commit, no working-tree copy. Same mechanism for the existing no-prefix backup. Configurable via the Settings UI and LEAFWIKI_GIT_BACKUP_PATH.

Would like to try it this way. Thanks @richardmilles for #1444.

perber avatar Sep 06 '26 10:09 perber

I'll try to clone git regular but work with "--data-dir" in another folder with leafwiki, will report here.

jochumdev avatar Sep 06 '26 19:09 jochumdev