gitgit-submodulesstarter-kits

Cloning a git starter project without throwing away the original git linkage?


I would like to clone a starter project for a javascript application. The starter project contains pre-configurations for development and nice folder structures etc. I would be developing my app inside that folder structure. I will be committing the starter project and all my files to my own repo.

What I want to know is, can I keep the linkage to the startup project repo so I can pull any of their changes to (for example) the build config files?

I looked into git submodules but don't think that will work since I am making changes inside the "sub-project".


Solution

  • Submodule is indeed not appropriate here.
    Branches are.

    You are talking about a template project that you are modifying.

    What you can do is to fork that project (or at least clone it and push it to your own new empty repo on a git repos hosting provider like GitHub or BitBucket)

    That means:

    This is a bit similar to the triangular workflow, except you won't contribute back through Pull Request to the "upstream" (here "template") repo:

    https://cloud.githubusercontent.com/assets/1319791/8943755/5dcdcae4-354a-11e5-9f82-915914fad4f7.png

    That way, you can git fetch template, and compare template/master with your own master, or even template/master and the previous template/master state (before the fetch), in order to detect any changes that you should incorporate into your current codebase.