Project layout:
/project_a
/shared
/project_b
/shared
/shared
project_a and project_b both need to contain the shared folder. With svn, we used svn:externalsand that worked fine, since svn can reference subdirs (with relative paths too). However, we moved to git and it seems to not support checking out subdirs.
Our solution now is to put project_a, project_b and shared all in different git repos, and use git submodules in project_a and project_b. However this seems much more complicated than one monolithic svn repo with svn:externals. What's the correct way to handle common elements in git?
EDIT: The consensus is submodules are the way to go. But having used it for a day, it seems very unfriendly to use.
After making a change to a file in shared, I have to:
- Commit the change in shared
- Push the change in share
- Add the shared directory again in the parent directory
- Push the parent directory
Compared to a single commit in svn, this seems way more complicated. And missing one of these steps results in a huge versioning mess. Am I missing something here?