user11174: I have a complex sketch that I spent many weeks working on, which I am backing up frequently because I'm afraid of losing any of my progress.
I'm wondering if it's common practice to make a self-contained package of the sketch and all its dependencies, so that it can be moved easily to another OS if necessary. My concern is that if my OS crashes and I have to reinstall everything or move to another OS, I might run into library and dependency errors, especially with the libraries that I altered/customized. I need my sketch to be able to compile as quickly as possible on whatever OS I end up using, since it's a home-automation sketch that controls dozens of things around me.
Is this a valid concern? And if so, what are some preferred ways to make a sketch become "self-contained", so that everything necessary is included? Is there some kind of a better version-control system for Arduino sketches that an amateur programmer might not be aware of?

user6424: A way to do so is to include all the library files (*.cpp, *.h) in your sketch folder and then include them in your code.
There are many solutions that you might find handy in this link: How to organize my Arduino projects' structure for easy source control?

user4143: I would suggest switching to UECIDE instead of the Arduino IDE. (Yes, shameless plug, it's my IDE).
UECIDE has a facility that I dubbed "localizing" a library whereby it copies it into a libraries folder within the sketch folder itself, and that copy of the library is used in preference to any other library named the same in the system.
That means that a sketch and its libraries then become completely self contained in one folder, and it's perfectly possible to have different versions of the same library in different sketches.

11174: <p>I have a complex sketch that I spent many weeks working on, which I am backing up frequently because I'm afraid of losing any of my progress.</p>

<p>I'm wondering if it's common practice to make a self-contained package of the sketch and all its dependencies, so that it can be moved easily to another OS if necessary. My concern is that if my OS crashes and I have to reinstall everything or move to another OS, I might run into library and dependency errors, especially with the libraries that I altered/customized. I need my sketch to be able to compile as quickly as possible on whatever OS I end up using, since it's a home-automation sketch that controls dozens of things around me.</p>

<p>Is this a valid concern? And if so, what are some preferred ways to make a sketch become "self-contained", so that everything necessary is included? Is there some kind of a better version-control system for Arduino sketches that an amateur programmer might not be aware of?</p>
 6424: <p>A way to do so is to include all the library files (*.cpp, *.h) in your sketch folder and then include them in your code.</p>

<p>There are many solutions that you might find handy in this link: <a href="https://arduino.stackexchange.com/questions/348/how-to-organize-my-arduino-projects-structure-for-easy-source-control">How to organize my Arduino projects&#39; structure for easy source control?</a></p>
 4143: <p>I would suggest switching to <a href="http://uecide.org" rel="nofollow">UECIDE</a> instead of the Arduino IDE. (Yes, shameless plug, it's my IDE).</p>

<p>UECIDE has a facility that I dubbed "localizing" a library whereby it copies it into a libraries folder within the sketch folder itself, and that copy of the library is used in preference to any other library named the same in the system.</p>

<p>That means that a sketch and its libraries then become completely self contained in one folder, and it's perfectly possible to have different versions of the same library in different sketches.</p>
