Version Control Git...
 
Notifications
Clear all

Version Control Git/GitHub/Other with Arduino IDE

6 Posts
4 Users
2 Likes
953 Views
TBerryKev
(@tberrykev)
Member
Joined: 1 year ago
Posts: 16
Topic starter  

One minor frustration I have had with Arduino IDE is the fear that I will break something when I am adding some feature to a working project.  I sometimes save a copy of my project but I don't have a very good system for doing it.  I just got clued in that Git can provide for versioning locally and GitHub can provide it remotely.  I've watched some helpful YouTube videos on GitHub in general and one on this topic by Andrew Spiess but it's all so new to me I could use more help/examples and I love the thoroughness with which you approach a topic.

I would love to see you produce something on one or more methods of keeping track of versions as we develop a project and the ability to back up when we mess something.

Thanks.

-- Kevin


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6495
 

Posted by: @tberrykev

One minor frustration I have had with Arduino IDE is the fear that I will break something when I am adding some feature to a working project.  I sometimes save a copy of my project but I don't have a very good system for doing it.  I just got clued in that Git can provide for versioning locally and GitHub can provide it remotely.  I've watched some helpful YouTube videos on GitHub in general and one on this topic by Andrew Spiess but it's all so new to me I could use more help/examples and I love the thoroughness with which you approach a topic.

I would love to see you produce something on one or more methods of keeping track of versions as we develop a project and the ability to back up when we mess something.

Thanks.

Hi Kevin, the IDE has an Archive menu item, that is your first line of defense. I am a professional programmer with over 50 years of experience but git was not something I learned. I do have a local git repository just in case it proves useful, but in all honesty, I doubt it. I have included screen grabs of the menu item and the result. I wish it saved the zip file one level down beside the project folder but it's workable. I only use it occasionally as the vast majority of sketches I write are big enough to worry about, I can either use comments or just re-write. When you are used to dealing with millions of lines of code, these sketches are trivial.

Screenshot 2023 02 06 at 12.34.05
Screenshot 2023 02 06 at 12.35.19

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6495
 

@tberrykev If you are using windows, it is a simple matter to create an auto backup by creating a bat file with the same name as the exe file, have the bat file do an archive then run ide.exe spelled in full with the exe so as to not be recursive. If you place a shortcut on the desktop to the bat file just dbl clicking it makes it work. Just name the zip file with yymmdd-hhmmss-sketchname and you have infinite backups. clean them to at your leisure. I keep trying to create the same for my Mac but it's much harder to do and I am stuck at the point where I need to specify a * name. the Mac keeps wanting to zip the entire HDD. Not friendly.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
ron bentley
(@ronbentley1)
Member
Joined: 2 years ago
Posts: 382
 

@tberrykev

Hi Kevin,

I use github for storing my code. It good at versioning, once you get your head around its structure and ways of doing things. However, I'm not a highly proficient user of it, I just use the features that are useful to me. I toughed it through learning what I needed. Perhaps the best way to start is YouTube and just dive in?

My last extension of github feature knowledge was packaging a couple of Arduino C++ libraries which integrate nicely with the Arduino IDE library manager under automatic version control.

Enjoy the journey!

😊

Ron B

Ron Bentley
Creativity is an input to innovation and change is the output from innovation. Braden Kelley
A computer is a machine for constructing mappings from input to output. Michael Kirby
Through great input you get great output. RZA
Gauss is great but Euler rocks!!


   
Inst-Tech reacted
ReplyQuote
TBerryKev
(@tberrykev)
Member
Joined: 1 year ago
Posts: 16
Topic starter  

Thanks @zander and @ronbentley1.  I also use the archive feature in Arduino IDE and since my files are on Dropbox, I can always get back to a previous version.   I'm not a programmer but because I have some experience with Petroleum Reservoir Simulation where we run thousands of variations of a model testing the sensitivity to uncertainties and differing assumptions regarding future events and operations, I recognize the potential for keeping track of modifications and different branches.

So far I have "completed" four Arduino projects with another almost ready to implement.  They all have opportunities to be improved/enhanced and I think I would really enjoy having the ability to track the coding changes I need to make and the results of those changes as I jump back and forth between projects.

I've watched several YouTube videos on the github approach and some have been very helpful, notably

, and 

and I can probably get there with these, but when Bill puts up a video from the DroneBotWorkshop, it will usually be a very thorough treatment with not just one approach but options to consider.  I think it would make a good contribution to the channel.

Thanks again for responding and sharing your advice.

 

Kevin

 

This post was modified 1 year ago by TBerryKev

-- Kevin


   
ron bentley reacted
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1042
 

I like this idea, so I'll mark it as approved!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote