I'm setting up automatic deployment of my Pelican blog using the newly-released Dropbox webhooks. Every time I change a file in Dropbox, it POST
s to my Heroku app, which does the following:
pelican
over the new content to reproduce the blog. The output is to the local clone of my Github Pages repo..git/
, so I run git init
and readd the remote.git pull origin master
to sync them up.git add -A .
.The problem is facing is in Step 4, when I run git pull
, it pulls all of the original information from the repo--including the files I want deleted. E.g., if I delete a post, it's properly deleted from the repo when I run pelican
and it deletes the whoel folder and regenerates the blog without the file--but then that file reappears when I run git pull
. I am not able to track which files are deleted because I lose my git history when .git/
is deleted when I run pelican
.
At the end of the day, all I want to do is to run pelican
, replace the entire contents of the repo, and then add all of the changes/deletsion/additions and then push the repo to Github. I will never need information on what's currently in the repo, so running git reset
wouldn't be a problem for me, if helps. How can I do this?
Since there seemed to be no way to do what I was trying to do in git, what I ended up doing was setting pelican's DELETE_OUTPUT_DIRECTORY
setting to False
and then as part of my Fabric script running
rm -rf *
myself instead, which ignores dot-prefix files and directories, and therefore left .git/
alone. Then I could regenerate and add the new content to the repository, commit, and push without issue.