Kristian
Kristian

Reputation: 3461

Git between multiple projects

I have multiple projects with directory structure like this:

/application/
/images/
/js/
/css/
/system/
index.php
.htaccess

Project specific files are in application folder, and "engine" stuff is in others(system/, css/, index.php, ..). Now i'd like to sync my system files, which are the same to all projects, but still will be edited. So how to sync images, js, css, system, index.php, .htaccess between multiple projects with GIT?

I'm new to git, but my first thought is to make master(empty) project, without application folder, and af i'll switch from project a to b, then first i'll push a to master project and then pull it to b. And maybe doing it via php. RIght now i have made a php script which i'll include to my every project and it doest the sync, but it has no versioning and is quite slow. I'm using cookie to store last used project by browser and if that cookie changes, then sync all projects. I guess i'll can to the same with git and exec().

Is there any better solution?

Upvotes: 3

Views: 189

Answers (1)

VonC
VonC

Reputation: 1324278

Git submodules (See Pro Git book) might help with:

  • a parent repo with all your common data
  • a submodule repo called application, with your applciation specific data in it

Upvotes: 1

Related Questions