While working on redesigning this site, I thought that it would be nice if I could have a repository dedicated only to handling blog posts. Search led me to git sparse checkout:

  1. Initialize a git repository
       $ git init <name>
    
  2. Configure to enable sparse checkouts:
       $ git config core.sparsecheckout true
    
  3. Edit .git/info/sparse-checkout to include the target file or directory.
       $ echo target/directory/or/file >> .git/info/sparse-checkout
    
  4. Add remote:
       $ git remote add -f origin https//github.com/my_github/project.git
    
  5. Fetch the files
       $ git pull origin master
    

The resulting git repository should contain only the directory or file specified in .git/info/sparse-checkout (In the case above, target/directory/or/file).

Now if I could make something like an export template for exporting org subtrees as jekyll post file, it would make these blog posts so much easier to make.