Feature request: Snapshot / “stable version” button to avoid losing work

Hi everyone,

several times I’ve lost important changes in my projects because Arduino IDE automatically saves files before compiling. After closing the project, I couldn’t get those intermediate changes back anymore.

I’d really appreciate a simple feature that lets the user save a snapshot / stable version of the current project — for example as a ZIP file inside the project folder. That way it would be easy to keep milestones without manually duplicating folders or using external tools.

Why it could help:

  • prevents accidental loss caused by auto-save
  • allows users to safely experiment and roll back
  • simple archive of project milestones

Possible alternatives that would solve the same problem:

  • an option to disable auto-save before compiling, or
  • a built-in “local history” feature.

Thanks for considering this — I think it would be especially helpful for beginners and hobby users.

Git

(That's not an insult!)

Welcome to the forum

Only if you don't change default behaviour in IDE Preferences

Hi @merkurrobot.

Which version of Arduino IDE are you using (e.g., "2.3.7")? The version is shown on the window title bar and also in the dialog that opens when you select Help > About (or Arduino IDE > About Arduino IDE for macOS users) from the Arduino IDE menus.

I ask for this information because I want to give you the appropriate support for the IDE version you are using.

The correct approach will be to disable the auto save feature. Then you can use the standard save feature to do this.

I know you indicated you don't want to use an external tool, but if you want this I recommend using Git. This is the industry standard method of version controlling software projects:

Git is a very powerful tool, so you might find it overwhelming if you look at all it is capable of. However, it is possible to obtain basic version control as you are describing without having to learn everything about Git. If you later find you need to accomplish more advanced things, you can then search out the information about how to accomplish that using Git.

Git is a command line tool, which might be inconvenient or intimidating to some. However, there are some excellent Git client applications that provide a graphical interface for version control. I think a good option will be GitHub Desktop:

https://github.com/apps/desktop

This free open source tool was created by GitHub, and it has features to facilitate working with Git repositories that are hosted on the GitHub website. However, GitHub Desktop is also a general purpose Git client and you can use it even to do version control on projects you only store on your local computer, or that you host on an alternative Git host.

If you don't find GitHub Desktop to your liking, there are quite a few other free open source alternatives:

Thanks for the explanation.
I am using Arduino IDE 2.3.7.

I usually keep auto-save disabled. However, after some updates (or sometimes “mysteriously”) it becomes enabled again even though I don’t remember ever turning it on myself. That is actually how I lost work a few times.

So yes — I know about the setting, but it isn’t always reliable in practice.

Regarding Git: I also use Git for some projects. My suggestion wasn’t because I don’t know about version control, but because many hobby users don’t want to deal with it. A simple “Save snapshot (ZIP)” button would be an easy safety net for typical Arduino sketches, especially when auto-save gets enabled by default after updates.

It wouldn’t replace Git — only provide a lightweight and intuitive option.

Thanks again for considering it.

There is an issue with the IDE where it sometimes looses settings. I use the serial monitor at the right and one day found it back at the bottom. Analysing I also found that some other settings where restored to default.

Unfortunately nobody had been able yet to reproduce it consistently and hence it's difficult to fix.

Note that the Arduino IDE 2.x "auto save" feature saves the sketch continuously; not only on compile. I was asking about the IDE version because the equivalent feature in Arduino IDE 1.x does have that behavior of only triggering a save on compilation or upload.

I was asking about the IDE version due to the resemblance of how you described the behavior to the 1.x behavior, and because the preference has a different name in each IDE version (so precise instructions for enabling the preference would be different for each version). Since you are already aware of the feature and how to adjust it, I don't need to provide instructions for disabling it.

I understand your intention. However, there are a couple of problems:

Problems

Scope Creep

Since version control capabilities are well covered by separate tools, this can be considered more of a "nice to have" supplemental feature, rather than an essential core part of an Arduino sketch development tool.

In additional to the initial implementation work, each feature adds ongoing maintenance overhead for the lifetime of the project.

Finite resources are available for the development and maintenance of the free open source Arduino IDE project. It will be best for us to dedicate those resources to ensuring the quality of the essential features. Some here feel that we are not even managing to accomplish even that (e.g., the settings reset bug you and @sterretje experienced), and would prefer that available resources be dedicated to fixing/improving the essential features.

This is the type of feature that will tend to produce its own scope creep, as version control is a very large technical domain. For example, I might request support for attaching a "commit message" to my snapshots, and to be able to view that message when browsing through the snapshots.

Technical Inferiority

The problem with using a version control system integrated into a application-specific IDE is that most people will end up wanting to also version control other types of projects. So you end up having to learn and remember how to use multiple version control systems.

Conversely, a single standalone version control tool such as GitHub Desktop can be used for all your projects. So you only need to gain proficiency with that one tool and you are set.


Alternative Solutions

If such a feature is wanted by the community, I would suggest accomplishing it via an extension. Additional capabilities can be added to Arduino IDE via VS Code extensions.

Existing Extension


:warning: Extensions are created by 3rd parties. The Arduino company does not have any involvement in the maintenance of these extensions, and does not officially support them. So the use of 3rd party extensions with Arduino IDE is very much an "at your own risk" thing.


There are thousands of existing free open source extensions. There is a registry of some of those extensions here:

I found this as the most used extension returned from a search for the term backup:

https://open-vsx.org/extension/xyz/local-history

I did a quick test and see that it does automatically save copies of the files under the .history subfolder of the sketch on each save. I was not able to use the extension's "restore" feature to roll back to those versions, so maybe you would need to manually roll back by getting the content from the saved file copy.

There are quite a few other similar extensions, which I did not evaluate.

If you are interested in giving it a try, you can follow the instructions here for installing extensions:

https://forum.arduino.cc/t/personal-themes/1024606/2#p-6646403-find-themefind-theme-3

Even though the post at the above link is about installing themes, a theme is just a specific type of extension and the same procedure can be used to install any type of extension.

Custom Extension

If the existing extensions do not meet your requirements, you also have the option of creating your own extension. Due to the extreme popularity of VS Code and its extensions framework, there is a tremendous amount of information on the Internet about creating extensions.

If you are searching for such information, keep in mind that there is nothing Arduino-specific about the subject. So avoid poisoning your searches by adding the "Arduino" keyword to the query.