Have multiple git projects in one












1















Im new at git and i don't have idea to do that.



Im building a template, which have a module pack and the module pack contains modules.



The modules can be instalated for separate and can have multiple versions of the same module (pro, simple..). (I think i can do branch in my module folder).



The pack of modules can instaled without template but need to have modules inside with the last version of they and this pack modules can have a version too, for example version one include module 1,2,3 ...



And finaly i have the template which have files too and the package of modules which have to had the last version of them.



In resume, i need to controll versions of all together and separate, but i have to had all of them in the same place



I think I could do this



 -- Template (git folder)
-- Module pack (git folder)
-- Module 1 (git folder)
-- Pro version (branch)
-- Simple version (branch)
-- Module 2 (git folder)
-- ....


Is this posible or I should think in other methods ? Thank you.










share|improve this question























  • We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

    – JB Nizet
    Dec 29 '18 at 13:38








  • 1





    git submodules, The Book, git subtrees.

    – phd
    Dec 29 '18 at 14:25


















1















Im new at git and i don't have idea to do that.



Im building a template, which have a module pack and the module pack contains modules.



The modules can be instalated for separate and can have multiple versions of the same module (pro, simple..). (I think i can do branch in my module folder).



The pack of modules can instaled without template but need to have modules inside with the last version of they and this pack modules can have a version too, for example version one include module 1,2,3 ...



And finaly i have the template which have files too and the package of modules which have to had the last version of them.



In resume, i need to controll versions of all together and separate, but i have to had all of them in the same place



I think I could do this



 -- Template (git folder)
-- Module pack (git folder)
-- Module 1 (git folder)
-- Pro version (branch)
-- Simple version (branch)
-- Module 2 (git folder)
-- ....


Is this posible or I should think in other methods ? Thank you.










share|improve this question























  • We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

    – JB Nizet
    Dec 29 '18 at 13:38








  • 1





    git submodules, The Book, git subtrees.

    – phd
    Dec 29 '18 at 14:25
















1












1








1








Im new at git and i don't have idea to do that.



Im building a template, which have a module pack and the module pack contains modules.



The modules can be instalated for separate and can have multiple versions of the same module (pro, simple..). (I think i can do branch in my module folder).



The pack of modules can instaled without template but need to have modules inside with the last version of they and this pack modules can have a version too, for example version one include module 1,2,3 ...



And finaly i have the template which have files too and the package of modules which have to had the last version of them.



In resume, i need to controll versions of all together and separate, but i have to had all of them in the same place



I think I could do this



 -- Template (git folder)
-- Module pack (git folder)
-- Module 1 (git folder)
-- Pro version (branch)
-- Simple version (branch)
-- Module 2 (git folder)
-- ....


Is this posible or I should think in other methods ? Thank you.










share|improve this question














Im new at git and i don't have idea to do that.



Im building a template, which have a module pack and the module pack contains modules.



The modules can be instalated for separate and can have multiple versions of the same module (pro, simple..). (I think i can do branch in my module folder).



The pack of modules can instaled without template but need to have modules inside with the last version of they and this pack modules can have a version too, for example version one include module 1,2,3 ...



And finaly i have the template which have files too and the package of modules which have to had the last version of them.



In resume, i need to controll versions of all together and separate, but i have to had all of them in the same place



I think I could do this



 -- Template (git folder)
-- Module pack (git folder)
-- Module 1 (git folder)
-- Pro version (branch)
-- Simple version (branch)
-- Module 2 (git folder)
-- ....


Is this posible or I should think in other methods ? Thank you.







git github






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 29 '18 at 13:14









Jordi CastilloJordi Castillo

376




376













  • We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

    – JB Nizet
    Dec 29 '18 at 13:38








  • 1





    git submodules, The Book, git subtrees.

    – phd
    Dec 29 '18 at 14:25





















  • We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

    – JB Nizet
    Dec 29 '18 at 13:38








  • 1





    git submodules, The Book, git subtrees.

    – phd
    Dec 29 '18 at 14:25



















We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

– JB Nizet
Dec 29 '18 at 13:38







We have no idea of what you mean by template or module. git doesn't know and care about what you store in a repo. You can store any kind of file you want, and create whatever branches you find useful to create. Don't confuse the sources, stored in git, and the artifacts that your build procedure creates, which are normally not stored in git.

– JB Nizet
Dec 29 '18 at 13:38






1




1





git submodules, The Book, git subtrees.

– phd
Dec 29 '18 at 14:25







git submodules, The Book, git subtrees.

– phd
Dec 29 '18 at 14:25














1 Answer
1






active

oldest

votes


















4














I just have a solution for your problem - gil (git links) tool



It allows to describe and manage complex git repositories dependencies.



Also it provides a solution to the git recursive submodules dependency problem.



Consider you have the following project dependencies:
sample git repository dependency graph



Then you can define .gitlinks file with repositories relation description:



# Projects
CppBenchmark CppBenchmark https://github.com/chronoxor/CppBenchmark.git master
CppCommon CppCommon https://github.com/chronoxor/CppCommon.git master
CppLogging CppLogging https://github.com/chronoxor/CppLogging.git master

# Modules
Catch2 modules/Catch2 https://github.com/catchorg/Catch2.git master
cpp-optparse modules/cpp-optparse https://github.com/weisslj/cpp-optparse.git master
fmt modules/fmt https://github.com/fmtlib/fmt.git master
HdrHistogram modules/HdrHistogram https://github.com/HdrHistogram/HdrHistogram_c.git master
zlib modules/zlib https://github.com/madler/zlib.git master

# Scripts
build scripts/build https://github.com/chronoxor/CppBuildScripts.git master
cmake scripts/cmake https://github.com/chronoxor/CppCMakeScripts.git master


Each line describe git link in the following format:




  1. Unique name of the repository

  2. Relative path of the repository (started from the path of .gitlinks file)

  3. Git repository which will be used in git clone command

  4. Repository branch to checkout


Empty line or line started with # are not parsed (treated as comment).



Finally you have to update your root sample repository:



# Clone and link all git links dependencies from .gitlinks file
gil clone
gil link

# The same result with a single command
gil update


As the result you'll clone all required projects and link them to each other in a proper way.



If you want to commit all changes in some repository with all changes in child linked repositories you can do it with a single command:



gil commit -a -m "Some big update"


Pull, push commands works in a similar way:



gil pull
gil push


Gil (git links) tool supports the following commands:



usage: gil command arguments
Supported commands:
help - show this help
context - command will show the current git link context of the current directory
clone - clone all repositories that are missed in the current context
link - link all repositories that are missed in the current context
update - clone and link in a single operation
pull - pull all repositories in the current directory
push - push all repositories in the current directory
commit - commit all repositories in the current directory


More about git recursive submodules dependency problem.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53969893%2fhave-multiple-git-projects-in-one%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    I just have a solution for your problem - gil (git links) tool



    It allows to describe and manage complex git repositories dependencies.



    Also it provides a solution to the git recursive submodules dependency problem.



    Consider you have the following project dependencies:
    sample git repository dependency graph



    Then you can define .gitlinks file with repositories relation description:



    # Projects
    CppBenchmark CppBenchmark https://github.com/chronoxor/CppBenchmark.git master
    CppCommon CppCommon https://github.com/chronoxor/CppCommon.git master
    CppLogging CppLogging https://github.com/chronoxor/CppLogging.git master

    # Modules
    Catch2 modules/Catch2 https://github.com/catchorg/Catch2.git master
    cpp-optparse modules/cpp-optparse https://github.com/weisslj/cpp-optparse.git master
    fmt modules/fmt https://github.com/fmtlib/fmt.git master
    HdrHistogram modules/HdrHistogram https://github.com/HdrHistogram/HdrHistogram_c.git master
    zlib modules/zlib https://github.com/madler/zlib.git master

    # Scripts
    build scripts/build https://github.com/chronoxor/CppBuildScripts.git master
    cmake scripts/cmake https://github.com/chronoxor/CppCMakeScripts.git master


    Each line describe git link in the following format:




    1. Unique name of the repository

    2. Relative path of the repository (started from the path of .gitlinks file)

    3. Git repository which will be used in git clone command

    4. Repository branch to checkout


    Empty line or line started with # are not parsed (treated as comment).



    Finally you have to update your root sample repository:



    # Clone and link all git links dependencies from .gitlinks file
    gil clone
    gil link

    # The same result with a single command
    gil update


    As the result you'll clone all required projects and link them to each other in a proper way.



    If you want to commit all changes in some repository with all changes in child linked repositories you can do it with a single command:



    gil commit -a -m "Some big update"


    Pull, push commands works in a similar way:



    gil pull
    gil push


    Gil (git links) tool supports the following commands:



    usage: gil command arguments
    Supported commands:
    help - show this help
    context - command will show the current git link context of the current directory
    clone - clone all repositories that are missed in the current context
    link - link all repositories that are missed in the current context
    update - clone and link in a single operation
    pull - pull all repositories in the current directory
    push - push all repositories in the current directory
    commit - commit all repositories in the current directory


    More about git recursive submodules dependency problem.






    share|improve this answer






























      4














      I just have a solution for your problem - gil (git links) tool



      It allows to describe and manage complex git repositories dependencies.



      Also it provides a solution to the git recursive submodules dependency problem.



      Consider you have the following project dependencies:
      sample git repository dependency graph



      Then you can define .gitlinks file with repositories relation description:



      # Projects
      CppBenchmark CppBenchmark https://github.com/chronoxor/CppBenchmark.git master
      CppCommon CppCommon https://github.com/chronoxor/CppCommon.git master
      CppLogging CppLogging https://github.com/chronoxor/CppLogging.git master

      # Modules
      Catch2 modules/Catch2 https://github.com/catchorg/Catch2.git master
      cpp-optparse modules/cpp-optparse https://github.com/weisslj/cpp-optparse.git master
      fmt modules/fmt https://github.com/fmtlib/fmt.git master
      HdrHistogram modules/HdrHistogram https://github.com/HdrHistogram/HdrHistogram_c.git master
      zlib modules/zlib https://github.com/madler/zlib.git master

      # Scripts
      build scripts/build https://github.com/chronoxor/CppBuildScripts.git master
      cmake scripts/cmake https://github.com/chronoxor/CppCMakeScripts.git master


      Each line describe git link in the following format:




      1. Unique name of the repository

      2. Relative path of the repository (started from the path of .gitlinks file)

      3. Git repository which will be used in git clone command

      4. Repository branch to checkout


      Empty line or line started with # are not parsed (treated as comment).



      Finally you have to update your root sample repository:



      # Clone and link all git links dependencies from .gitlinks file
      gil clone
      gil link

      # The same result with a single command
      gil update


      As the result you'll clone all required projects and link them to each other in a proper way.



      If you want to commit all changes in some repository with all changes in child linked repositories you can do it with a single command:



      gil commit -a -m "Some big update"


      Pull, push commands works in a similar way:



      gil pull
      gil push


      Gil (git links) tool supports the following commands:



      usage: gil command arguments
      Supported commands:
      help - show this help
      context - command will show the current git link context of the current directory
      clone - clone all repositories that are missed in the current context
      link - link all repositories that are missed in the current context
      update - clone and link in a single operation
      pull - pull all repositories in the current directory
      push - push all repositories in the current directory
      commit - commit all repositories in the current directory


      More about git recursive submodules dependency problem.






      share|improve this answer




























        4












        4








        4







        I just have a solution for your problem - gil (git links) tool



        It allows to describe and manage complex git repositories dependencies.



        Also it provides a solution to the git recursive submodules dependency problem.



        Consider you have the following project dependencies:
        sample git repository dependency graph



        Then you can define .gitlinks file with repositories relation description:



        # Projects
        CppBenchmark CppBenchmark https://github.com/chronoxor/CppBenchmark.git master
        CppCommon CppCommon https://github.com/chronoxor/CppCommon.git master
        CppLogging CppLogging https://github.com/chronoxor/CppLogging.git master

        # Modules
        Catch2 modules/Catch2 https://github.com/catchorg/Catch2.git master
        cpp-optparse modules/cpp-optparse https://github.com/weisslj/cpp-optparse.git master
        fmt modules/fmt https://github.com/fmtlib/fmt.git master
        HdrHistogram modules/HdrHistogram https://github.com/HdrHistogram/HdrHistogram_c.git master
        zlib modules/zlib https://github.com/madler/zlib.git master

        # Scripts
        build scripts/build https://github.com/chronoxor/CppBuildScripts.git master
        cmake scripts/cmake https://github.com/chronoxor/CppCMakeScripts.git master


        Each line describe git link in the following format:




        1. Unique name of the repository

        2. Relative path of the repository (started from the path of .gitlinks file)

        3. Git repository which will be used in git clone command

        4. Repository branch to checkout


        Empty line or line started with # are not parsed (treated as comment).



        Finally you have to update your root sample repository:



        # Clone and link all git links dependencies from .gitlinks file
        gil clone
        gil link

        # The same result with a single command
        gil update


        As the result you'll clone all required projects and link them to each other in a proper way.



        If you want to commit all changes in some repository with all changes in child linked repositories you can do it with a single command:



        gil commit -a -m "Some big update"


        Pull, push commands works in a similar way:



        gil pull
        gil push


        Gil (git links) tool supports the following commands:



        usage: gil command arguments
        Supported commands:
        help - show this help
        context - command will show the current git link context of the current directory
        clone - clone all repositories that are missed in the current context
        link - link all repositories that are missed in the current context
        update - clone and link in a single operation
        pull - pull all repositories in the current directory
        push - push all repositories in the current directory
        commit - commit all repositories in the current directory


        More about git recursive submodules dependency problem.






        share|improve this answer















        I just have a solution for your problem - gil (git links) tool



        It allows to describe and manage complex git repositories dependencies.



        Also it provides a solution to the git recursive submodules dependency problem.



        Consider you have the following project dependencies:
        sample git repository dependency graph



        Then you can define .gitlinks file with repositories relation description:



        # Projects
        CppBenchmark CppBenchmark https://github.com/chronoxor/CppBenchmark.git master
        CppCommon CppCommon https://github.com/chronoxor/CppCommon.git master
        CppLogging CppLogging https://github.com/chronoxor/CppLogging.git master

        # Modules
        Catch2 modules/Catch2 https://github.com/catchorg/Catch2.git master
        cpp-optparse modules/cpp-optparse https://github.com/weisslj/cpp-optparse.git master
        fmt modules/fmt https://github.com/fmtlib/fmt.git master
        HdrHistogram modules/HdrHistogram https://github.com/HdrHistogram/HdrHistogram_c.git master
        zlib modules/zlib https://github.com/madler/zlib.git master

        # Scripts
        build scripts/build https://github.com/chronoxor/CppBuildScripts.git master
        cmake scripts/cmake https://github.com/chronoxor/CppCMakeScripts.git master


        Each line describe git link in the following format:




        1. Unique name of the repository

        2. Relative path of the repository (started from the path of .gitlinks file)

        3. Git repository which will be used in git clone command

        4. Repository branch to checkout


        Empty line or line started with # are not parsed (treated as comment).



        Finally you have to update your root sample repository:



        # Clone and link all git links dependencies from .gitlinks file
        gil clone
        gil link

        # The same result with a single command
        gil update


        As the result you'll clone all required projects and link them to each other in a proper way.



        If you want to commit all changes in some repository with all changes in child linked repositories you can do it with a single command:



        gil commit -a -m "Some big update"


        Pull, push commands works in a similar way:



        gil pull
        gil push


        Gil (git links) tool supports the following commands:



        usage: gil command arguments
        Supported commands:
        help - show this help
        context - command will show the current git link context of the current directory
        clone - clone all repositories that are missed in the current context
        link - link all repositories that are missed in the current context
        update - clone and link in a single operation
        pull - pull all repositories in the current directory
        push - push all repositories in the current directory
        commit - commit all repositories in the current directory


        More about git recursive submodules dependency problem.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 1 at 1:42

























        answered Dec 29 '18 at 15:11









        chronoxorchronoxor

        356115




        356115






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53969893%2fhave-multiple-git-projects-in-one%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mossoró

            Can't read property showImagePicker of undefined in react native iOS

            Pushsharp Apns notification error: 'InvalidToken'