问题
I need to publish several related Arduino projects on GitHub. For this purpose, I'm figuring out how to run Git.
In my project, I have split the code into libraries and the higher level application. Libraries are shared across several projects. Arduino environment (like many others) dictates the directory for the libraries that the libraries should reside at <arduino>\libraries\<my_library>
. So, the files necessary to build the projects are split between several unrelated directories. From what I've read, Git repo is, by definition, one directory.
I'd like the libraries and the projects to commit together to the same repo on GitHub. Of course, I could copy the library files manually, but that can introduce human error.
Prior art
- There were some answers in this thread. But, I don't yet understand Git well enough to get what VonC is suggesting there.
- In this one, the O.P. didn't solve the problem, judging from his comments.
Any suggestion, insight or reference is really appreciated!
回答1:
Have a look at using Git Submodules for the libraries that are going to be shared across different projects.
来源:https://stackoverflow.com/questions/11066254/git-repository-for-a-project-that-has-files-in-unrelated-directories