distill icon indicating copy to clipboard operation
distill copied to clipboard

Guidance for version controlling files

Open mikemc opened this issue 3 years ago • 2 comments

I greatly appreciate how easy it is to get a nice-looking, well-functioning blog working with this package. The one thing I am a bit confused about regarding the writing and publishing workflow is what files I should place under version control. Following the workflow of rendering posts individually, then then running rmarkdown::render_site() to render the whole site, leads to a lot of duplication of files in the _posts/ and _site/ directories, and some files (like the html file) that are not complete duplicates but largely redundant. In most of the Distill blogs on Github, and in the various tutorials online, users seem to be committing all of these files, including the site libraries which get duplicated in each post in _posts/ and start to add up to a lot of files for many posts. I'm not sure if this is purely because it's easier to git add everything or if there is a reason to track the content in _posts/ and _site/ to ensure reproducibility or something. I'm very interested to know if the creators can give any guidance about whether it is a good idea to

  1. Track everything, including the site library, figure, and html files in _posts/ directory that are produced by rendering the the R-markdown files, even if you're also tracking all of _site
  2. Just track the R markdown files and the _site/ folder
  3. Something else.

I think it could be helpful if the documentation added a recommendation about how to most effectively use version control in the Creating a Blog or Blog Post Workflow pages. I understand there may not be a one-size-fits-all answer here, in which case perhaps a note clarifying the relationship of the various files would help confused users like me make a good decision for them.

mikemc avatar Apr 09 '21 21:04 mikemc