0

If I want to create a module inside the vendor folder, what are the git commands to create a subtree (or somehting else)?

Scenario: I update the module Push it to github

My colleague wants the update too, should he pull from github, or just update composer? Then he has to make his own changes and push them too github

I tried some solutions but I felt like they where not the best, how does everybody else do this?

Scenario: I want to override some view files from an existing module and create my own module for this (yes it has to be a module), extending from the original module Do I need extra steps for this? And a separate composer package? How can my colleague install this module and make some changes?

Ruben
  • 8,956
  • 14
  • 63
  • 102

1 Answers1

0

If you want the module to be accessible to everybody the easiest way to do this is to create a composer package for it. Then you just add it to the composer.json file and you can both use the package just by doing a composer update.

Remember to tie the git repository to packagist (through webhooks, when you create the packagist package you will see instructions), so each time you update git, an update to packagist will be available.

To push an update the module just browse to that particular path and do a commit / push to git like any other package.

If you do not want to create a packagist package, then you can always create a repository like this in composer.json Use PHP composer to clone git repo.

Community
  • 1
  • 1
Mihai P.
  • 9,307
  • 3
  • 38
  • 49
  • thanks, should I add the module to my composer file too? – Ruben Sep 22 '14 at 11:37
  • What if my colleague wants to contribute to this module? What are the steps? Install with composer, add git remote, or just pull with git.. – Ruben Sep 23 '14 at 08:42
  • Install with composer, if you take a look after the installation with composer, what composer does is actually gets all the files with git. You can push, commit etc without any problems. – Mihai P. Sep 24 '14 at 08:02
  • thanks man, last question, what if I want to override an existing module, I don't need to put it on packagist, but I still needs to be a separate module – Ruben Sep 24 '14 at 08:39
  • Puting it on packagist is always optional, it is usually easier to put it there. If you do not want to make it public then use the link I gave you in my answer. – Mihai P. Sep 24 '14 at 14:19