Versioning

Every time I work on a document, I like to save the old version and create a new file.
So suppose I am working on a novel called Harold. I write a chapter, save it, and start on a new document called Harold 2.
It would be nice to automate this process and in addition to adding the version number, append the date to the file title.

I had macro in Word that did this for me.
Thanks.

2 Likes

There is versioning if you have Obsidian Sync. It’s not exactly what you’re asking for, but it does have previous versions of the file (probably a lot more than you want).

Until a plugin exists, there may be ways to speed the process. For example if you’re on Mac or iOS you could make a shortcut in Shortcuts, and use the Shortcut Launcher community plugin to send it the note name and run it.

I assume you are familiar with the version history built-in to obsidian, so I imagine you’re looking for something more precise/user defined. Sorry I don’t know much on that front, but thought I would mention that just in case. ps. I’m not talking about the sync version history. There is a built-in version history that can save it locally every x minutes. I use it all the time.

But your idea also made me think of how useful it could be to have a version history slider in each note, so we wouldn’t have to go to the settings and do this manually.

It might be a bit overkill but you could use git, either with the Obsidian Git plugin or from the command line or a different git GUI. Git has a lot of powerful and complicated features but you might only need to deal with making commits on a single branch.

It sounds like all you need is a template: enable the templates plugin and you can create a “chapter version” template that autofills whatever you want. Your template might look something like this:

---
date: {{date:YYYYMMDD}}{{time:HHmm}}
version: 2
previous: [[Harold]]
---
# {{title}}

You could also use the unique note creator plugin to create a note with the date in the title.


If you want something a little more robust, git is a great option for version control. It’s a little technical to get it set up, but once you set it up it works automatically. Git will store version numbers, date and time of edits, and exactly what changed every time you change a file, which allows you to see exactly how a file develops over time. And you can also set it up to automatically backup your work, so you never risk losing anything. It’s a great system if you can invest an hour or two to get it set up.

See this tutorial if you want to learn more about that.

Can you help me understand the purpose of using git instead of obsidian’s built in file recovery?

The best way to start would be to read the documentation page of the obsidian git plugin: Start here - Git Documentation - Obsidian Publish

There are many benefits to git. The simple way to say it is that it’s a much more robust system than the file recovery plugin. A few of the benefits that come to mind are:

  • Git allows you to quickly and easily fix mistakes. If you install a community plugin that accidentally deletes or reformats a thousand files, you only have to run a single command to fix all of them. This alone makes git worth it for me, it gives me great peace of mind. (with the File Recovery plugin you would have to manually fix every file. Possible, but a huge pain)
  • Git is great for backups and syncing across devices
  • Git stores history across platforms. The file recovery plugin doesn’t save data across devices (unless you pay for Obsidian Sync. So in a way, you could say git is a free Obsidian Sync, with more bells and whistles)
  • Infinite history. The file recovery plugin deletes file history after a (configurable) number of days, whereas git stores it forever
  • Git works everywhere, and isn’t tied to Obsidian. Plain text files stored in git can be edited and synced from and to virtually any device… or even a web browser.
  • Git is open source and not dependent on any one company or server. If you want to sync with it, you can choose your own server (or even create your own)
  • Git has many more “power features” that you can tap into if you desire.

The downsides are:

  • It’s tricky to set up, and there are a few new concepts that you’ll need to learn
  • It doesn’t have a nice interface by default in Obsidian (although there are plenty of nice apps out there that you can use, on all platforms)

For small mistakes I think File Recovery is quicker and easier (which doesn’t negate the rest of your point or your other points).

And for the average user with no git account, and no need for one apart from this, it’s likely to be more trouble than it’s worth.

True, for people who don’t know git and have a simple/small vault, learning git may be overkill. But the bigger the vault becomes, the more helpful (and potentially game changing) it is.

And you don’t need an account to use git, that’s Github. Git is free software you can download on your computer, Github is a social network for git repos. Common misunderstanding.

I think I was reacting to the usual reason behind git recommendations which is as a sync method

Ok, I can see the benefit. But to be honest, it is not viable for the vast majority of people. I consider myself relatively tech-savvy, and look at this and think setting git up looks like it’s not too much trouble (since I’ve done a thousand things just like it) but when it came to actually setting it up, “it’s more effort than it’s worth” is the exact phrase that came to mind. Unless someone makes a step-by-step video tutorial, I’m unlikely to ever set git up, and so are most people. I’m not saying this to disparage the idea, I’m mostly saying it in exasperation. I value my time and the paid sync option is getting more and more appealing.

I agree, it’s not for everyone. There are very few things that are—oxygen and food might be the whole list :slightly_smiling_face:

Sync is a great option too, it’s easier to use and has less of a learning curve. But git is the only system I know of that can handle absolutely anything you throw at it. It’s a big hammer for driving big nails, but you don’t necessarily need a big hammer for thumb tacks. :slightly_smiling_face:

What about something like this? How to create repeated vault backups with a .BAT file and Task Scheduler on Windows

There is a wonderful, simple software I have used for twenty years: Beanland: AutoVer

It just watches the folders you specify and makes a copy of them when they change.

Hope that helps,

Russell