Git, sub-repos & external libs for web development - best strategy once and for all?

前端 未结 2 601
北荒
北荒 2021-02-02 14:54

This is such a common scenario that there must be a sensible solution, yet despite pages of reading and copious Git gymnastics, my brain aches and I\'m unable to make this work.

相关标签:
2条回答
  • 2021-02-02 14:55

    Clearly you've been thinking about this, and I am only a novice at git, but my first instinct would be to add .gitignore to the plugins directory and have each plugin have it's own git repo. You could do the same for themes. So I guess this is more of a question than an answer - why wouldn't this simple approach work?

    0 讨论(0)
  • 2021-02-02 15:17

    I don't know if this will answer your question in full, or even cover your specific scenario, but I thought I'd give it a go in any case.

    We have multiple projects, many of which reference each other, each in their own Git repository. They are also contained in multiple levels of folders, for example:

    Repos
        - Utilities
            - Util repo1
            - Util repo2
        - Common
            - Lib repo1
            - Lib repo2
        - Projects
            - Client1
                - Git repo1
                - Git repo2
            - Client2 repo
            - Client3
            ...
    

    We had an issue with manually having to push / pull / commit each repository, which became a nightmare.

    So we wrote a little utility program that is able to do push, pull, commit, tag, remote diff and diff Git operations on multiple folders at a time, as well as build multiple VS solution files at the same time. It will also check in sub folders for repositories.

    We have been using it for some time now, and it works fine for us. You can check it out from here: Gitter.7z

    Open the ReadMe.html file to see how to use it. Hope this helps out, let me know.

    0 讨论(0)
提交回复
热议问题