Discussion:
[hakyll] Tutorial Feeback: Dangerous error in Github Pages tutorial
p***@berkeley.edu
2016-06-24 13:45:45 UTC
Permalink
The tutorial for deploying a Hakyll-generated website to Github Pages (here
<https://jaspervdj.be/hakyll/tutorials/github-pages-tutorial.html>) can
possibly delete your entire Hakyll setup if the user uses the "rsync"
command given on the page. I had this happen to me. This occurs because the
command

rsync -a --filter='P _site/' --delete-excluded _site/ .


only protects the "_site" folder, and so deletes other essential things
like the ".git" folder! This leaves you of no way of switching back to the
"develop" branch as specified in the tutorial. A safer, more conservative
version of this command is

rsync -a --filter='P _site/' --filter='P _cache/' --filter='P .git/' --filter='P .gitignore' --delete-excluded _site/ .


This preserves the ".git" subfolder as well as the .gitignore file.

A secondary suggestion is that there is no need to delete the master branch
every time you deploy.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jasper Van der Jeugt
2016-06-24 14:30:48 UTC
Permalink
Thanks for the suggestion. I think that makes sense. Would you mind
submitting a PR to fix this, or add this as a note? The code is in
the `web` directory of this repo:

https://github.com/jaspervdj/hakyll/

Peace,
Jasper
The tutorial for deploying a Hakyll-generated website to Github Pages (here)
can possibly delete your entire Hakyll setup if the user uses the "rsync"
command given on the page. I had this happen to me. This occurs because the
command
rsync -a --filter='P _site/' --delete-excluded _site/ .
only protects the "_site" folder, and so deletes other essential things like
the ".git" folder! This leaves you of no way of switching back to the
"develop" branch as specified in the tutorial. A safer, more conservative
version of this command is
rsync -a --filter='P _site/' --filter='P _cache/' --filter='P .git/'
--filter='P .gitignore' --delete-excluded _site/ .
This preserves the ".git" subfolder as well as the .gitignore file.
A secondary suggestion is that there is no need to delete the master branch
every time you deploy.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...