This website is being built. Services described here are not yet available to order; the free tools work now. See what is ready.
SelfPublishingTool

Manuscript preparation

How to Version-Control a Book Manuscript Using Git and Plain Text

On 29 October 1974, Brian W. Kernighan of Bell Laboratories issued a technical memorandum called “UNIX for Beginners.” In a section of hints for preparing documents, he advised writers: “Start each sentence on a new line,” and “Make lines short, and break lines at natural places, such as after commas and semicolons, rather than randomly.” His reasoning, as quoted by the programmer Brandon Rhodes, began with an observation about how people revise: “Since most people change documents by rewriting phrases and adding, deleting and rearranging sentences,” a file arranged by sentences is easier to change.1 Half a century later, that advice is the practical foundation for anyone who wants to version-control a book manuscript with Git, the version-control system most software is now written in.

This article explains how an author can keep a book in plain text under Git, what the method gains over a folder of dated Word files, and where it meets friction, chiefly at the point where editors and typesetters expect a Word document. It relies on the Pro Git book published on the Git project’s website, the Git reference documentation, GitHub’s documentation, the Pandoc user’s guide, and a peer-reviewed lesson in Programming Historian.

Git records snapshots of text files, so a manuscript must be plain text to benefit

Git keeps a complete history of a project as a series of saved states. The Pro Git book explains that while “most other systems store information as a list of file-based changes,” Git “thinks of its data more like a series of snapshots of a miniature filesystem,” so that “every time you commit, or save the state of your project, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.”2 The history lives on the author’s own computer: “Most operations in Git need only local files and resources to operate,” and “Because you have the entire history of the project right there on your local disk, most operations seem almost instantaneous.”3

Git also guards that history against silent damage. “Everything in Git is checksummed before it is stored and is then referred to by that checksum,” using a SHA-1 hash, “a 40-character string composed of hexadecimal characters.”4 A file cannot change in the history without the change being detectable.

These features work with any file, but Git’s most useful ability, showing exactly what changed between two versions, depends on the file being text. Pro Git calls version control of Word documents “one of the most annoying problems known to humanity,” because by default Git can report only that “Binary files a/chapter1.docx and b/chapter1.docx differ.”5 The book offers a workaround: a Git attribute that sends Word files through a converter such as docx2txt before comparing them, so that Git can “convert Word documents into readable text files, which it will then diff properly.”6 It also states the limit of that approach: “formatting changes wouldn’t show up here.”7 An author who wants Git’s full benefit therefore writes in plain text from the start and treats Word as an output, not as the master copy.

Plain text and Markdown keep a manuscript readable for decades

Plain text means a file that holds only characters, with structure marked by simple conventions rather than hidden formatting codes. Markdown is the most widely used of those conventions: a pound sign begins a heading, asterisks mark italics, and a blank line separates paragraphs. A chapter written this way can be opened in any text editor on any computer.

Dennis Tenen and Grant Wythoff make the case for this approach in “Sustainable Authorship in Plain Text using Pandoc and Markdown,” a lesson published in the peer-reviewed journal Programming Historian in March 2014.8 They argue that “Writing in plain text guarantees that your files will remain readable ten, fifteen, twenty years from now,” and that “MS Word may go the way of Word Perfect in the future, but plain text will always remain easy to read.”9 They also connect the format directly to revision tracking: “plain text enables easy and powerful versioning of the document, which is useful in collaboration and organizing drafts.”10

Their lesson was written for scholarly articles, but the reasoning applies with more force to books. A novel or nonfiction book may be drafted over several years, revised for a second edition a decade later, and reissued in formats that did not exist when it was written. A plain-text master copy survives all of that without conversion.

One sentence per line makes each revision visible

Git compares files line by line. If a whole paragraph sits on a single line, as it does when a writer lets the text editor wrap long lines, then changing one word marks the entire paragraph as changed. Rhodes, in a 2012 essay titled “Semantic Linefeeds,” gives exactly this example and explains that with one clause or sentence per line, the same edit touches only the affected lines, and the rest of the paragraph does not appear in the comparison.11 He reports having used the practice for more than twenty years in several markup languages.12

The practice costs nothing in the finished book. Markdown treats a single line break inside a paragraph as a space, so a paragraph written as six lines still prints as one paragraph. Only a blank line starts a new paragraph. The source file looks unusual at first, with ragged lines of varying length, but it reads easily in an editor and makes the history of the book far easier to follow.

Git can also compare at the level of words rather than lines. Its configuration options include diff.wordRegex, described in the reference documentation as “A POSIX Extended Regular Expression used to determine what is a”word” when performing word-by-word difference calculations.”13 Word-level comparison is useful for prose, where a revision often changes a single word in a long sentence, and it works well alongside one-sentence-per-line formatting.

A book repository needs a simple, predictable layout

A Git project is called a repository, and its structure is up to the author. A layout that has worked for many plain-text books keeps one file per chapter, numbered so that the files sort in reading order, alongside separate folders for front matter, back matter, and images. A style sheet recording spelling, capitalization, and usage decisions can live in the same repository, as can a glossary or character list. Each of these then has its own history, and a change to the style sheet can be traced to the chapter revision that prompted it.

Images and other large files need care. As of November 2026, GitHub’s documentation states that “If you attempt to add or update a file that is larger than 50 MiB, you will receive a warning from Git,” and that “GitHub blocks files larger than 100 MiB.”14 It recommends that repositories “remain small, ideally less than 1 GB, and less than 5 GB is strongly recommended,” and states that “To track files beyond this limit, you must use Git Large File Storage (Git LFS).”15 High-resolution print images for an illustrated book can approach those sizes. An author can keep image files outside the main repository, track them with Git LFS, or store reduced working copies in the repository and keep the print masters elsewhere. Other hosting services set their own limits.

Git’s three states also shape the daily routine. Pro Git defines them precisely: “Modified means that you have changed the file but have not committed it to your database yet”; “Staged means that you have marked a modified file in its current version to go into your next commit snapshot”; and “Committed means that the data is safely stored in your local database.”16 For a writer, a sensible habit is to commit at the end of each writing session, with a short message describing the work (“Ch. 7: rewrite opening scene; cut flashback”). The messages become a readable log of the book’s composition.

Commits, branches, and tags map onto drafts, experiments, and editions

Three Git features correspond closely to stages in a book’s life. Commits record ordinary progress. Branches let an author try a substantial change, such as restructuring the second act or testing a different point of view, without disturbing the main draft; if the experiment fails, the branch can be abandoned, and if it succeeds, it can be merged back. Tags mark versions that matter outside the writing room.

Pro Git describes tags as a way “to tag specific points in a repository’s history as being important,” noting that “Typically, people use this functionality to mark release points (v1.0, v2.0 and so on).”17 It distinguishes lightweight tags, which are “just a pointer to a specific commit,” from annotated tags, which “are stored as full objects in the Git database” and “contain the tagger name, email, and date” along with a message.18 The book states that “It’s generally recommended that you create annotated tags so you can have all this information.”19

For a manuscript, natural tags include the version sent to beta readers, the version sent to the developmental editor, the version returned after copyediting, the version sent to the typesetter, and each published edition. Tagging the published edition is especially useful for self-published authors, who can revise and re-upload a book at any time. If a reader reports an error in the first printing, the tag shows exactly what text that printing contained, which matters when deciding whether a correction is minor or whether the changes amount to a new edition with its own ISBN.

Editors and typesetters usually expect Word, so the workflow needs a conversion step

The main practical obstacle is the rest of the publishing world. Most freelance editors work in Microsoft Word with Track Changes, and many typesetters expect a Word file as input. A plain-text workflow therefore needs a reliable way to produce Word documents and, ideally, to bring edits back.

Pandoc is the tool most often used for that conversion. Its user’s guide describes it as “a Haskell library for converting from one markup format to another, and a command-line tool that uses this library.”20 Tenen and Wythoff’s lesson uses it to turn a single Markdown source into Word, PDF, and HTML.21 For Word output, Pandoc’s --reference-doc option will “Use the specified file as a style reference in producing a docx or ODT file,” which means an author can supply a Word template whose paragraph and character styles match what the editor or typesetter expects.22 Using named styles in this way also produces a cleaner file for typesetting than direct formatting does.

The return trip is harder. Pandoc can read Word files, and its --track-changes option “Specifies what to do with insertions, deletions, and comments produced by the MS Word”Track Changes” feature,” where “accept (the default) processes all the insertions and deletions. reject ignores them.”23 A third setting, all, keeps insertions, deletions, and comments and marks each one in the output.24 In principle, an author can convert an edited Word file back to Markdown with all changes accepted and then let Git show exactly what the editor changed. In practice, the manual also warns that “conversions from formats more expressive than pandoc’s Markdown can be expected to be lossy,” so formatting an editor added in Word, such as a special paragraph style, may not survive.25

Many authors resolve this by treating the copyedit as a handoff point. Drafting and developmental revision happen in plain text under Git. The copyedited Word file then becomes the master for the remaining production stages, and the author commits it to the repository as a binary file, perhaps with the docx2txt comparison described in Pro Git, so that the history remains complete.26 Others convert each round of edits back to Markdown and review the differences in Git. Both approaches are workable; the choice depends on how much formatting the book carries and how comfortable the author is reviewing changes outside Word.

A repository is a backup only when it exists in more than one place

Because Git stores the full history locally, a repository on a single laptop is no safer than the laptop. A remote copy on a hosting service or a second machine, updated regularly by pushing commits to it, protects against loss. The checksums that Pro Git describes protect against corruption of the history, but they cannot protect a disk that fails.27 Authors writing material that should not be public, such as memoir drafts or unpublished fiction, should confirm that any hosted repository is set to private and should read the host’s terms before uploading.

Version control also complements, rather than replaces, ordinary backups. A repository records what was committed; work written since the last commit exists only in the working files. A file-level backup or cloud sync of the working folder covers that gap.

The method suits some books better than others

Git and plain text work best for books whose structure is mostly prose with headings, notes, and occasional images: novels, memoirs, and most trade nonfiction. They work less well for heavily designed books, such as cookbooks with complex layouts, picture books, or textbooks with many sidebars, where the meaningful work happens in the layout file rather than the text, and where layout files from InDesign or Affinity Publisher are binary and cannot be compared line by line. Pandoc’s own warning about lossy conversion is a reminder that Markdown cannot express everything a typesetter can.28

The learning cost is also real. Git’s commands and concepts were designed for programmers, and an author who adopts it will spend some hours learning to commit, branch, tag, and push. For authors who already work in plain text, or who expect to revise a book across many years and several editions, that investment buys a precise, durable record of every change. For an author writing one book in Word with a single editor, a disciplined system of dated file copies may be enough. Kernighan’s 1974 advice holds in either case: a manuscript arranged so that its changes are easy to see is a manuscript that is easier to revise.29

Platform rules, fees and laws change. Facts in this guide are dated to when they were checked; confirm current terms with the platform or authority before relying on them. Nothing here is legal, tax or financial advice.

More guides Free publishing tools