HACKER Q&A
📣 deafpolygon

Best way to version control your notes or documents?


I see git as a pretty popular way to version control your code, and to an extent, your documentation. For my code, I think it's great.

For people with other types of documents, is git still ideal? I find git a bit lacking, and I'm not aware of any other solid version control system geared towards writing (notes, journals, books, articles).


  👤 j3d Accepted Answer ✓
I recently switched from using Google Docs to storing my notes in Markdown/Git and making them available just to myself via Docusaurus on a private Gitlab Pages repo.

Benefits: 1. Free 2. Securely available from any web browser. Only people added to you repo can access the published notes. 3. Clean interface with solid search capability 4. Versioned 5. Easy cross-linking 6. Can edit locally or on the web, both with preview

Cons: 1. Requires a little upfront setup. See [0] 2. Requires familiarity with Markdown 3. Requires free Gitlab account

I am pretty happy with this now. I'm able to organize and search my notes at https://.gitlab.io/ name> and the 1-click edit link takes me to the Gitlab web IDE where I can make changes, see the preview, and commit changes.

[0]: https://jedfonner.com/2023/01/22/private-kb


👤 eevmanu
IMO having your notes locally (instead of using a any `webapp` or `local-first webapp`) + confortable editor (as example, `vscode`) + search tool with a decent speed (as example, like `ripgrep`) is unbeatable.

if you require to sync and save your notes, create a private repo and create a shortcut to do a commit with blank message (`git commit --allow-empty-message -m ''`) + pushing to remote repo at your demand whenever you need it (could be useful to put it in a cronjob)

you won't create an interesting history on your repo but ultimately, regardless of third-party feedback, it must be useful to you.

PD: execute chatGPT-like searches on your own local personal documentation (knowledge base) which automatically scrape content from any link you saved and retrain the model at your demand without the need to pay a monthly subscription would be amazing.


👤 h0p3
I can tell you how I do it, but I dunno if that will be useful to you.

Every time I save an edit to a page in ⦗ℍπ•ͺ𝕑𝕖𝕣𝔱𝔒𝔡𝔱: h0p3⦘, two jsons are created in a subdirectory of `~/Downloads`, an old and new copy of the edited page. That's usually the only versioning I directly use. I'm finished editing the majority of pages within a week (except for retroactive footnotes, which are themselves dated upon injection), but there are some pages I've edited thousands of times; all of it is captured, and I can archive or delete these at my leisure. Sometimes, I'll walk through my nightly zstd archives (and I've not had to go through my waterfall backups across drives yet), and even more often just use web.archive.org (since it's all wrapped into one html file). I've always wanted extremely lightweight automated versioning (not what I already do by hand, as I sometimes explicitly link together versions of a page) built into my wiki itself (none of the plugins available really do it well, imho), and I may work toward that.

I do have git repos available, and I know some found it useful. Traditionally, I keep a 2-minutely updated git repo (reset nightly), as well as a nightly. Something has gone wrong when I use it, but perhaps that's a lack of practical creativity otherwise on my part. For those participating in the mutable torrent swarm, hidden default Resilio Sync archives have provided useful versions to myself and others as well.

I'm paranoic about keeping a record of my streams of thought and the objects I grow in my garden, and I often find the most important aspects of the versioning of my thinking (and feeling) are captured by just thoroughly using and living with the tool in the first place.


👤 jayflux
I tried using git for general note taking and I hated it. I used Foam, which is markdown inside of VSCode synced to Git, accompanied with GitJournal which allows you to update the same markdown files from a mobile device.

Constantly putting in commit messages, dealing with conflicts, and syncing became annoying to the point it put me off making notes. For me, notes should be quick and frictionless. I am sometimes in a position where I’m away from the computer and want to take a quick note of something on my phone.

So I switched to Joplin (markdown based but has a sync feature you can self-host), then I can move notes to git once they’re in a state I want to publish or have more long term storage. Joplin is basically an open source equivalent to Evernote, it does the job and I get to keep the format in markdown.

It doesn’t have version control but there was a request to add this some time ago https://github.com/laurent22/joplin/issues/753


👤 theknarf
For personal notes I mostly use Notion. But for a while I used Obsidian with markdown files stored in a Git repository, this mostly worked fine.

In a professional capacity I use Docusaurus for project documentation, this is stored in the same Git repo as the rest of our products source code (so one monorepo both for code and documentation).


👤 jjwtieke
Word and G Docs both have versions. You can, with some limitations, go back and view an earlier version of a document you’ve been working on. I use this all the time when my boss deletes the wording/paragraph I know my bosses boss wants to see so when they ask for it I can just copy paste back into the current live version.

👤 frou_dh
For general note-taking, I never want to have to bother with manually committing updates. The saving and syncing should be automatic. A separate general-purpose backup system running on the whole disk is good enough for the rare case of wanting to fish out a historical version of a note.

👤 Leftium
https://simplenote.com/ automatically stores history for each note:

> Notes are backed up with every change, so you can see what you noted last week or last month.

I have used this feature, but only very rarely. It would be nice if SimpleNote could also search the note history, too.


👤 jonas-w
I use nextcloud for this. Any file in nextcloud is versioned. I won't have these versions at my fingertips (on my local computer) but can roll back versions in the webui. This is also great when you accidentally overwrite a file or delete it.

👤 softwaredoug
I have found logseq and its git integration really powerful for organizing my professional life. I treat it as a mind map of where things stand, but with versioning and an ability to take notes. Highly recommended.

👤 abudabi123
For plaintext documents in Emacs the diff command is useful but enabling the fossil-mode has more steps, and Fossil has extra plumbing for ticketing and webui.

    https://fossil-scm.org

👤 mejutoco
I keep everything in obsidian (markdown) and use git, committing regularly. It simplifies a lot to alltogether avoid binary formats.

👤 taubek
Maybe some wiki that tracks changes?

👤 pydry
Yes, but I created a one click script to sync (git add, commit, pull, merge and push).

👤 mbfg
if git sees the document type as an opaque thing, like various MS types, git diff is not a pleasant thing. i'm surprised someone hasn't made a differ for them for git. (Maybe they have, just haven't seen it).

👤 ddtaylor
Try GNOME Tomboy with GitHub Sync.

👤 replwoacause
I use Github wiki