From f7047b5bdf45d800addf9c753385d3848e22c8c7 Mon Sep 17 00:00:00 2001 From: Jakub Z Date: Tue, 6 Sep 2016 18:53:05 +0100 Subject: Update git fetch and fix rsync for stack --- web/tutorials/github-pages-tutorial.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'web') diff --git a/web/tutorials/github-pages-tutorial.md b/web/tutorials/github-pages-tutorial.md index 67410bd..7681353 100644 --- a/web/tutorials/github-pages-tutorial.md +++ b/web/tutorials/github-pages-tutorial.md @@ -86,7 +86,7 @@ stack exec myblog build Update the local list of remote branches to ensure we're able to checkout the branch we want in the next step. ``` -git fetch -all +git fetch --all ``` Switch to the `master` branch. @@ -142,7 +142,7 @@ stack exec myblog clean stack exec myblog build # Get previous files -git fetch -all +git fetch --all git checkout -b master --track origin/master # Overwrite existing files with new files @@ -168,7 +168,13 @@ git stash pop Earlier 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`. ``` -rsync -a --filter='P _site/' --filter='P _cache/' --filter='P .git/' --filter='P .gitignore' --delete-excluded _site/ . +rsync -a --filter='P _site/' \ + --filter='P _cache/' \ + --filter='P .git/' \ + --filter='P .gitignore' \ + --filter='P .stack-work' \ + --delete-excluded \ + _site/ . ``` The 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. -- cgit v1.2.3