on master help sign in
Update git fetch and fix rsync for stack
commitf7047b5bdf45d800addf9c753385d3848e22c8c7 authorJakub Z <jakzale@gmail.com> dateTue 6 Sep 2016, 18:53 (10 years ago) parent2fff87b
1 file changed+9−3
web/tutorials/github-pages-tutorial.md+9−3
web/tutorials/github-pages-tutorial.md+9−3
@@ -86,7 +86,7 @@ stack exec myblog build
8686Update the local list of remote branches to ensure we're able to checkout the branch we want in the next step.
8787
8888```
89−git fetch -all
89+git fetch --all
9090```
9191
9292Switch to the `master` branch.
@@ -142,7 +142,7 @@ stack exec myblog clean
142142stack exec myblog build
143143
144144# Get previous files
145−git fetch -all
145+git fetch --all
146146git checkout -b master --track origin/master
147147
148148# Overwrite existing files with new files
@@ -168,7 +168,13 @@ git stash pop
168168Earlier it was mentioned a flaw is that deleted files will persist in the published site until deleted manually. This is easily overcome by using `rsync` instead of `cp`.
169169
170170```
171−rsync -a --filter='P _site/' --filter='P _cache/' --filter='P .git/' --filter='P .gitignore' --delete-excluded _site/ .
171+rsync -a --filter='P _site/' \
172+ --filter='P _cache/' \
173+ --filter='P .git/' \
174+ --filter='P .gitignore' \
175+ --filter='P .stack-work' \
176+ --delete-excluded \
177+ _site/ .
172178```
173179
174180The only drawback this approach has is the requirement that *every* file in your site "go through" Hakyll. Fortunately, in many cases this is not an issue.