Using git to manage Arduino projects

I'm wondering if anyone has any suggestions for managing Arduino projects that use libraries using the git version control system. Since the library directory exists in the same directory as individual projects it seems impossible to make a library that is used by your project a submodule.


I am not exactly sure what the issue is. But, maybe if I explain how I have been versioning my Arduino projects, it will help you out.

Typically in a VCS you would keep track of each project and library separate. But, what I have done is checked in my entire Arduino directory. This way, if I have updates to any of my libraries, boards, etc.. It all gets versioned.

For any project that is huge enough that may warrant merging, branching, tagging or the occasional roll back, I will use Eclipse for. The project ill reside in my Eclipse workbench. Which is outside of the Arduino directory.

I use Hg, but git is very similar.

If you wanted, you could check in each project. Which is typically the recommended way to do it. But, for ease of use I check in the entire Arduino directory. If you are flying solo, this would work just fine. If you are collaborating with a team, you may want to break it down to a project level check-in.

Every team has their preferred way of handling software versioning.

Hope this helps!


So my issue is that I am going to have many projects and many libraries and maybe 3-5 users. The libraries will be changing over time so I want to track them as sub modules, but git cannot track a project outside of the folder where it located.

Actually I figured out how to do it… If I have a library in the libraries folder it is included using the <>, if I put it in the project I can just include it using the local path using “”. My libraries can just be duplicated in each project with the specific version needed for that specific project.