Git repository for a project that has files in unrelated directories

跟風遠走 提交于 2019-12-12 01:46:54

问题


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

  1. There were some answers in this thread. But, I don't yet understand Git well enough to get what VonC is suggesting there.
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!