Rather than having one repo for a jekyll site and mixing up the git history with commits for the site and the content, I'm using a git submodule for posts.
See this guide for an overview of the setup.
To keep things simple, write posts in the actual "blog posts" repo. Don't edit the submodule in the jekyll repo. The usual workflow is:
- In the
blog-postsrepo: write posts and push to the remote when ready - In the main site repo: grab updated submodule with
git submodule update --remote, and then commit and push the change to publish to your site