š¾ Archived View for gemini.jayeless.net āŗ gemlog āŗ 2021-08-04-git-for-writing.gmi captured on 2023-09-08 at 15:52:15. Gemini links have been rewritten to link to archived content
ā¬ ļø Previous capture (2022-03-01)
-=-=-=-=-=-=-
In recent days, Iāve been making good progress on the novel Iāve been working on, off and on, for years. Back in 2017, I ācompletedā a first draft (the third quarter was still much too rushed, but at least there were no outright missing bits) and since then Iāve been trying to refine it into something actually presentable. One complication I found was that, while working in plain Markdown felt refreshingly efficient for the initial drafting, it became a lot less workable as I re-drafted and re-drafted and needed to go back to find previous versions of different scenes. I have all these subfolders called ā2017 Draftā, ā2018 Draftā, ā2019 Draftā, etc. but even that felt not-very-workable because Iāve had so many disruptions since 2018 that the bulk of the chapters have not really changed since then, while Iāve found myself rewriting the early chapters much more often than once a year. (As an aside, I know this is a problem ā no oneās ever finished a novel by re-writing and re-writing the first 10% ā but every time I cold-open my novel thatās where I start, and I canāt just let the flaws there go un-fixedā¦)
I have dabbled in a few different tools, like Novlr or Scrivener, that wouldāve offered me proper version control, but all of them ended up feeling unsatisfactory. I just preferred Markdown to rich-text editing ā and appreciated the peace of mind of knowing that all my files were plain text saved directly in my filesystem, and completely app-agnostic. I can change Markdown editors on a whim (and have, multiple times!) and donāt have to export/import my story or translate the format in any way, so long as Iām only switching between Markdown editors (and not black-box closed ones like Ulysses).
It was a bit of a conundrum for a little while, how to have my plain Markdown files and proper version control. Itās fortunate that I decided to get back into blogging, because it was this that led me to my solution: Git. Now probably if youāre a programmer this solution was staring you in the face from the beginning, but thatās not my field at all, and even though Iād heard of Git Iād never really looked into it until a few months ago because I thought it was some really complicated shit that only programmers can understand. But I was talking about my website and the things I wanted to do with it with my Dad (who *is* a programmer), and he encouraged me to look into Git, reckoning that it was not that hard. I worked through this tutorial website called Learn Git Branching, and while initially I applied that knowledge to set up Indiekit and automate rebuilds of my Hugo site, I also created a private repository on Github to host my novel files. Just last week I finally transferred my various drafts to that Github repository, and since then, what do you know! Iāve found it so pleasant to work with this set-up, using Typora as my Markdown editor, that Iāve actually been really productive!
There has been one drawback to Github, and itās that it doesnāt deal with file renames properly. Instead, it acts as if you deleted the old file and created a brand-new one with no history. This is less than ideal for me, because Iāve long been using a number at the start of each file name to make them all appear in order, so I regularly need to rename files and would prefer not to detach them from their histories when I do. Iād also read before I even embarked on this project that Git itself understands renames just fine so long as you donāt substantially rewrite the file at the same time, so I was a bit put out that Github wasnāt handling it. Fortunately, I came across a comment on a Github issue, mentioning that GitLab manages this functionality perfectly well. So, today, I moved that repo across to GitLab (well, duplicated it, technically, for now). Iām just unfamiliar enough with GitLabās website layout for it to feel uncomfortable for now, but Iām sure Iāll get used to it over time ā and I can confirm it handles individual file histories properly š
There are two more major features of Git that I feel are helpful in managing my novel.
The first is tags. I started out by uploading the files from my different drafts over the top of one another, using the tagging system to tag the novel as it was at specific moments in time (i.e. before I forked and started my new subfolder with the next draft). Not only would this be a useful system to mark different drafts, but if you (like me) are prone to major reorganisations of content, it might help to be able to ātagā the last commit pre-reorganisation, so you can go back to it easily if you need to. (Thatās if you donāt just branch it, of course, but more on that next paragraph.) Of course, because Git hosts are usually expecting to host software, they tend to correlate ātagsā to āreleasesāā¦ in a writing context, I found this kind of cute š Like, āAww, you think I released this story anywhere just because I finished a draft? Thatās cute!ā But anyway, the point is just that you can find specific points in your projectās history easily.
The second useful feature is branches. As I mentioned, Iāve been somewhat indecisive as to how I even want to structure my book. My original draft had it skipping forwards and back in time, but on a cold reread I thought that made the beginning kind of jumpy, so I thought Iād try reorganising it to make it strictly chronological. Iām not 100% committed to it being strictly chronological, though ā skipping back and forth did have some genuine advantages, which is why I wrote it that way in the first place ā so Iāve kept these two approaches as two different branches for now ā no problem!
Again, Git hosts expect you to use their platform to make software, where if there are different versions, usually youād create those at the building and packaging stage, not by maintaining different branches in the repository. But thereās no reason you canāt use Git like this. Itās pretty versatile.
So overall, Iām feeling much happier now: I can work iteratively on my novel, secure in the knowledge that a full version history ā at the project level *and* the file level ā is right there, and that I can edit in whatever light-weight editor, from whatever device, I want. Iāll admit that switching over to GitLab today has made for a bit of a distraction from my recent productivity (and now Iām wondering whether to move my website repositories too, and what to do about the duplicates š ), but I should now have laid a good foundation for future work. Honestly, I wish Iād thought to look into Git ages ago, because it works so well for what I want to do.