I'm very new to git, and still trying to wrap my head around some of the ways it does certain things as opposed to svn, and I'm wondering whether or not what I'm attempting to do is even possible. I'm trying to create a repository for an Arduino project that will include several Arduino "sketches", as well as multiple libraries. Some of these libraries I will be writing, and some come from other, existing repositories belonging to other people, which are dependencies for the code I'll be writing. The local folder structure for Arduino projects works like this:
~/Arduino
+libraries
+MyLib1/[lib files]
+MyLib2/[..]
+MySketch1/MySketch1.ino
+MySketch2/MySketch2.ino
(SketchName.ino is just the Arduino naming convention for what is basically main.cpp)
Now, the repositories I've looked at vary in their structure. Some contain the Arduino folder within their top level, some map their top level to the Arduino folder, and some only contain libraries, and map their top level to Arduino/libraries. Is there any way to combine these multiple repositories into my own, keeping the links to the original repositories? I've looked into submodules, but it appears that those only work within their own subdirectories, which wouldn't work for me, because I need the local folder structure to contain all sketches in the same ~/Arduino folder, and all libraries within the ~/Arduino/libraries folder.
So I want to have the above folder structure coexist with another repo containing:
libraries
+YourLib1/[..]
+YourLib2/[..]
YourSketch/YourSketch.ino
And a third repo containing:
AnotherRandomLib/[..]
such that the end result is a single repo that looks like this;
~/Arduino
+libraries
+AnotherRandomLib/[..]
+MyLib1/[..]
+MyLib2/[lib files]
+YourLib1/[..]
+YourLib2/[..]
+MySketch1/MySketch1.ino
+MySketch2/MySketch2.ino
+YourSketch/YourSketch.ino
Can this be done, or if not, what would be considered "best practices" for referencing other people's code from within your repo? Just add the files to the repo (simple, bulletproof, but breaks linking to the original repo, losing the ability to pull in updates, and also causes loss of attribution)? Leave them out of the repo and leave it to the user to find and download those other libraries separately (not at all a good solution)? Any ideas?