I use Jekyll with a custom Coderay, so I have to maintain 2 branches on GitHub
master; The generated HTML site
source; Markdown files, etc
On the source branch I have a _includes folder that I ignore because it just contains some hard links. I have a script to manage the 2 branches but it seems like there should be something better than what I have come up with.
# Start on "source" branch
jekyll /tmp
git checkout master
git stash -u # _includes
rm -r * # keeps ".git"
cp -r /tmp/* .
git add -A
git commit
git push origin master
git checkout source
git stash apply
Option 1
The better option for me was to just get rid of the hard links altogether. I did this by making a plugin that allows to render a file outside of the repo.
render_partial.rb
Option 2
This option will work if you want to keep the hard links.
help.github.com/ignore-files