I was listening to The Amp Hour podcast yesterday and the talk was all about hardware revision control from a startup called AllSpice. This got me thinking about all my own projects and how i have them not stored in an efficient and meaningful way.
Currently stuff is all over the place, firmware in one place, ecad in another, datasheets in yet another and other documents strewn all around my documents folder and the internet. My plan here is to bring all the relevant bits together into one place for each individual project.
Each project now has its own directory with the following directory structure. The picture below is for the 50w antenna tuner project. Its the only one i have sorted out enough to have all its bits in one place HEHE.
The Arduino folder contains the firmware for this project, the datasheets folder contains just one datasheet, the one for the relays I used. The point here is to have the datasheet for any new parts that I am using on hand with the project to ensure i do not make footprint mistakes. The documents folder is so i can make notes and will contain files i might have found on the internet etc that inspired the project. The other 3 are just to keep the ecad files all nice and tidy.
So with the directory structure under control and able to suit my needs, the next thing was setting up GIT. Ok, I am not a GIT fanboy, the last time I used a repository in anger was many years ago when i was a programmer for a free online game and then the main game in town was Subversion. Off to learn GIT we go.
This is where things start to become less helpful for you the reader because i am going to gloss over a lot of things here, because so much of this is specific to you, your operating system and who is hosting your git repos.
First thing i did was download and install GIT for windows. Next thing I did was install and configure GIT on my server and setup the repo. I am self hosted and have control over the entire machine, so not much I can tell you what to do here. But for most of you, it would be setup your account on github and make your first repo.
The rest of this is the easy part, on your local machine setup the folder structure you are going to use, put some files in there and open up git. I used git bash because i prefer the unix like command line.
Navigate to the location where your files are located, you can see above for me where things are located. Next we start making git commands.
First initialize the git repo.
Next we add all the files we just moved in there to our repo. I always cheat here and just use the * wildcard to add everything.
git commit -m "initial commit"
Then we commit the changes we have made to the repo. The comments in quotation marks are so you know what you have changed since the last time you committed changes to the repo. Make them as descriptive as you require.
git remote add origin https://MYSERVER/MY_REPO.git
Next we setup an origin, this is more or less just a shortcut to the remote server so you do not have to type out http://some.long.url.com/my_repo.git all the time. It just makes things simple and easy.Just use the url to your repo supplied by github here is that is where you are hosting.
git push -u origin master
Finally we push our changes to the remote servers master branch of our repository. We are then done. From here on out its just a matter of following steps 2 to 5 each time you either make changes or add new files to the repo. I am only using 1 repo for all my various projects and having them hanging off a single directory, but you might like to have separate repos for all your projects.
Depending on how you have your git repos setup, you might also have to use your username and password when pushing changes to the remote server. I have mine setup so only a single user can read and write to the git repository rather than being public.
So that is about it, now i have the unenviable job of spending a bunch of time sorting out my project files into some kind of sanity and then sticking to the system. HAHAHA wish me luck.