Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Best way to version control your notes or documents?
19 points by deafpolygon on Feb 7, 2023 | hide | past | favorite | 31 comments
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).



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://<gitlabusername>.gitlab.io/<repo 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


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.


PD2: looks like today, two tools to achieve chatGPT-like searches were announced:

- Supabase Clippy ‣ https://supabase.com/blog/chatgpt-supabase-docs

- Medable.ai ‣ https://www.mendable.ai/


This is kind of what I'm doing now. I have two scripts - push-notes and pull-notes and I call them when I need to. Git doesn't really provide a good interface for tracking notes and document changes, but it's all I've got for the moment.


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.


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


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).


I haven't really heard about anyone going from Notion to Obsidian. What does Notion do right? I find the lack of local files a bit disturbing.


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.


Yeah - I like this, to an extent - it works. You can get this on OneDrive or DropBox as well, but I don't want to do everything in Word.


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.


Years ago I ran a custom script to add/commit/push on a folder once a day. So, nightly/automatically like a system backup, but in git.


> A separate general-purpose backup system running on the whole disk

Do you have a suggestion for Windows (11)?

I agree on your first point though.. which is what prompted my question.


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.


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.


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.


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


Even diff is a bit unwieldy, unless I were looking for specific changes between particular versions. But I'd like one that can visualize or show how a document or note changes over time, but also one that makes it easy to browse through past versions without having to checkout/check-in changes.


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


You have to manual commit right? I wish there is an automatic way of doing that, like on every save command.


There is! I use this plugin: https://github.com/denolehov/obsidian-git


Cheers! Will take a closer look.


I commit manually with a simple message `gg notes` or something like that. `gg` in an alias to `git commit -m` but it should be easy to automate it with a cronjob or so.


Maybe some wiki that tracks changes?


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


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).


The differ is `git diff`. If you insist on putting in binary files, it's not going to show you a textual diff. If you run `unzip` beforehand and put in the plain text contents of the ZIP (DOCX) instead of trying to put the ZIP in itself, then you'll get a textual diff.


sure, but a zip of text, is a stretch to call binary. In theory you could git diff these and have sensible output.


What?


Try GNOME Tomboy with GitHub Sync.


I use Github wiki




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: