2

We have a couple projects that use the same Plugins + libs (some common code that wraps the Plugins and also some general as well, like a math library for example)

We need to have them as a separate from the main repository because we share them between a few projects.

Currently, Plugins and libs are two separate submodules attached to the main project. The problem is that it is not convenient to manage them like that because committing to the Plugins most often than not you also commit to the "libs" to hook up the new .dll for example. One option is to move that "libs" into the Plugins but we would like to avoid this option if possible.

For example, if we just could move the Plugins a layer deeper we could do

Assets/common/Plugins
             /libs

where "common" is a new submodule that has both Plugins and libs in it (as just files, not sub-submodules). It would solve all our problems.

If you can't actually move plugins (like settings its new path somewhere) then is there some other way to solve this problem?

P.S. subtree is probably also not an option, because as I understand it - it required everyone on the team to avoid committing from different repositories at the same time (like root and Plugins would be in our example), use "git subtree push" instead and also doesn't have a great UI support (which is needed because most of the team are not programmers-like but still use git all the time), so we would preferably live without it to avoid future complications.

1 Answer 1

1

Git has support for symlinks, they work in other places of Unity, although you are informed in a warning that symlinks might break things.

Symlinks work well at least on OS X and Windows 10 with Cygwin (with CYGWIN=symlinks:native setup). Never tried with more native Windows clients, but Windows does support what you need with directory junctions - not sure if git wouldn't automate that, though.

So, assuming you can use symlinks, you would have:

Assets
  |-- common            <--- git submodule
  |     |-- Plugins <----------+
  |     +-- libs               |
  |-- Plugins                  |  
  |     |-- some-other-plugin  |
  |     +-- common ------------+ <-- symlink to
  |                            Assets/common/Plugins
1
  • Thank you for the response, we will try this solution
    – Stals
    Commented Sep 2, 2016 at 12:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.