Maintaining a Git repo inside another git repo

后端 未结 3 1418
天命终不由人
天命终不由人 2020-12-13 15:11

I have a git repo which contains an AngularJS web app.

It has a subfolder called build, which gets created by a gulp task. I am deploying to Azure, so

3条回答
  •  天命终不由人
    2020-12-13 15:48

    You can do this with git submodule or subtree, I use submodule for this kind of reason.

    https://git-scm.com/docs/git-submodule

    example :

    /mainrepository
    /mainrepository/subrepository
    
    cd /mainrepository/subrepository;
    git init .
    cd ../
    git submodule add ./subrepository
    
    then open seperate remote repository in bit bucket then 
    cd into ./subrepository
    git remote add origin https://bitbucket.com/path/to/subrepository.git
    

    basically it is all about that.

    I have no detailed information about subtrees what I know, it is more advanced than submodules. But if your needs are basically matches with submodules it is easy to maintain.

提交回复
热议问题