1

I'm building a relatively large project which involved few servers running php.

All the servers have few shared classes they need to use.

When design the git and the project structure, it seams logical to me to write the core (shared) classes, and then wrap them up somehow (maybe Composer?) and let anyone of the specific server just the have them as dispense.

I've read some very bad reviews about git submodules, so I was wonder what alternative do I have ?

I'm trying to achieve a basic core part of the code that will be a dispense for each of the servers.

7
  • Sure, composer would be a good solution. With composer, you don't have to use git submodules. Commented May 12, 2015 at 11:25
  • but do I need to have it as 2 completely different projects ? Commented May 12, 2015 at 11:26
  • Oh, I see, you want to keep one structure and just extract the core as a composer package. Haven't tried myself. Maybe there is a possibility to use 2 separate git repositories with different .gitignore... I would go with two separate projects. Commented May 12, 2015 at 11:31
  • submodules should do the trick, but its very unrecommended from different articles I read Commented May 12, 2015 at 11:35
  • 1
    This question belongs either to "Software Recommendations" or "Superuser" i.m.o. because it does not directly involve programing. Besides of that, yes, seperating the "library" and the "application" makes sense. Commented May 12, 2015 at 11:40

1 Answer 1

2

Ok after doing some further research I decided to go with git subtree feature. I allows me to divid my code into modules inject remote modules as part of my code.

Like everything in git, there's a learning curve, but in this case it seems like it total worth it.

I used those 2 blog posts as tutorial:

https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844

https://www.atlassian.com/git/articles/alternatives-to-git-submodule-git-subtree/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.