Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GIT when I have multiple files shared between multiple projects

Tags:

git

I have some projects which have a lot of files in common. My question is how to organize the structure of these projects in GIT. I came from MKS and PVCS which are per-file version control system. I read about GIT submodules, but I do not know if they are the solution. The thing I am most worried is the linking the files to the projects: For example if I found a bug in one project file and that file is used in other 2 projects I must manually replace the file in the other 2 GIT repos. How can I do this in an efficient way?

like image 560
Gripen Avatar asked Feb 15 '12 12:02

Gripen


1 Answers

Yes, you can use "submodule" for this purpose.

To deal with more complex things you can use "subtree" extension:

https://github.com/apenwarr/git-subtree

like image 107
vedi Avatar answered Nov 15 '22 10:11

vedi