4

I have a core set of files I use for almost every project which at times I copy back from the other projects with each project also has its own unique files. But that process is cumbersome.

How does one deal with multiple projects and keeping all the core files in sync between master and projects without copying all the files in the project folder around?

Can I break off a branch into a new repo but still track changes forward and back?

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
fiscme
  • 422
  • 1
  • 6
  • 20
  • Ok thanks everyone. So I could individual repos for each project that share submodules with the 'core' repo? So when one submodule changes on any one of the repository I can push those changes back through to any other report I like? 'Push' might not be correct terminology there.. still learning that! – fiscme Oct 28 '11 at 16:22

4 Answers4

4

One possibility is that you put your core routines in a repository called "core" or something like that and then add that as a submodule to all your other projects.

Umopepisdn
  • 807
  • 6
  • 16
Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
3

Check out git submodules.

(Har! No pun intended.)

Vivek Aditya
  • 1,145
  • 17
  • 46
Alex Howansky
  • 50,515
  • 8
  • 78
  • 98
1

branches in git are probably not the best solution for your problem, but submodules are! but you need a repository for each project, plus a repository for your core files/libs.

Marian Theisen
  • 6,100
  • 29
  • 39
0

hmm... tough one maybe use a symlink?

Could you change the structure in which those shared items are in a shared repo and that is checked out on its own. This way, you ideally have 3 repos for 2 projects as example.

1 master 2 branch 3 shared

Using an MVC always helps with this at gitgo.. ;)

hookedonit
  • 56
  • 4
  • symlink may not a good idea especially when you have some user with Windows which doesn't support it. – Enze Chi Oct 29 '11 at 02:09