mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

is 'mdbook build --dest-dir=/tmp/dir1' remove '/tmp/dr1/*'

Open ayoubelmhamdi opened this issue 3 years ago • 1 comments

I want to use worktree in temp dir

$ git worktree add /tmp/dir1/html gh-pages

to commit the new files or modified files only

but, mdBook remove all old files and .git in /tmp/dir1/html/.git when I use:

mdbook build --dest-dir=/tmp/dir1

ayoubelmhamdi avatar Sep 12 '22 11:09 ayoubelmhamdi

The recommended workflow is to generate into a separate directory and copy the files over. There is more information at https://github.com/rust-lang/mdBook/wiki/Automated-Deployment%3A-GitHub-Pages about the recommended steps.

--dest-dir doesn't know about git, and I don't think it generally should. It's purpose is to have a clean directory where it can place all output.

ehuss avatar Sep 12 '22 13:09 ehuss