Keeping Posts in Sync in Git

Let’s say I have a repo with my Eleventy site that has a few different folders with my markdown files for each post. A pretty typical Eleventy setup. If I am writing posts but also making tweaks to my HTML/CSS for some different design ideas in a different fork, what is it the best way to make sure the same markdown posts are staying in sync across every fork? I know this is probably some git magic I am not entirely experienced with, so I am curious to hear how other people might approach this problem.

Thanks!
-scott

Sounds to me like a basic merge to me. I write my posts on my master and make any changes to site structure or presentation on a new branch. Basic Branching has that covered in the Git docs. But others may have another way, maybe an easier way.

1 Like

It might also be worth looking into git sub modules, but you’re opening a door to hell with that, so be forewarned!

1 Like

Yes, but could you do a merge on a specific directory or set of files? I’d want just the markdown files to be in sync across all forks.

Checked my email and saw this notification and figured I would answer even though I’m supposed to be unplugged for a bit…

For a specific file

git checkout source_branch <path_to_file>...

For the directory, it may be a little work, but you could try this method.

1 Like