开发者

Using Git with shared (symbolic link) directories

I'm working on a big Qt application with multiple widgets which are quite complex. One of this widget is a webcam stream viewer.

The application is organized so that each program module (i.e. widgets) is stored in its own directory with a .pri file. All these are stored in one main directory grouping all the widget directories.

Next to this main project directory I also have application directories. Let say one for each widget. In these directory I have a symbolic link (alias on windows) to the module directory in the main project folder. This application has then the necessary code to build a standalone application showing only the widget. So for instance I have a webcam viewer application, another to control some devices, etc.

This source code organization works well and allows me to develop and test the widgets in independent applications while sharing the code with the main application.

开发者_如何学JAVA

Currently only the main project directory is under version control using subversion.

Now I would like to start using git and would like to know if this shared directory model would work with it or if there is a better way to do it.


Using submodules, you could define:

  • one main project with n branches (one per widget/test application)
  • one git repo per widget/test application

That way, your main project references all widgets, but you can only focus and test on one on them, depending the branch you are in.
Or you can just clone one of the widget/test app repos and work only on that.

The idea remains: make sure to have related data within one Git repo.
That is why you won't find all widgets within one Git repo, because their development lifecycle could be very different one widget from another.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜