Take the 2-minute tour ×

I have a cakephp project. Let us call it Project Super.

It has its own github repo.

Super has git submodule that pulls from this repo. https://github.com/predominant/TwigView

The issue is that I need to have my own project specific extensions, so I need to create new files in the Lib folder of https://github.com/predominant/TwigView and I need to add require_once statements inside the file View/TwigView.php of https://github.com/predominant/TwigView

I want to maintain the git submodule as much as I can.

I know I can fork the https://github.com/predominant/TwigView and add the project specific extension files and changes.

Super would then have this forked version as git submodule.

However, I am not pleased with that because that means

  1. it is slightly harder to update the forked version from its upstream
  2. I need to have 1 forked version per project.

What would be the cleanest, and easily maintainable way to use https://github.com/predominant/TwigView as a git submodule in Project Super and other cakephp projects?

share|improve this question

1 Answer 1

up vote 0 down vote accepted
  1. no, it should be that much harder to update your forked project.
    If you just add upstream (original TwigView repo) as a remote, you can pull any changes from upstream to your local submodule, and push back to your fork.
    (as described in "Pull new updates for forked Github repository")
    Granted, it is slightly harder, but is the recommended workflow.
  2. Why one fork per repo?
    The idea behind a fork is to gain publication privileges (you can push to a fork because you own it).
    Why not push to a branch-per-project within the unique TwigView fork?
share|improve this answer

Your Answer


