![]() Git checkout -b branch_child2 child2/master If you want to get the changes from children remote repo to the parent repo, you can use: git subtree pull -prefix=child1 masterįor adding remotes of the children repositories to parent repo, the files from the children repos can't be added to the parent repo's working directory automatically: # add remote and fetch children reposĮven you can checkout the files from children repos, but they located in different branches (branch_child1 and branch_child2) in parent repo: git checkout -b branch_child1 child1/master If you want to push changes to the children remote repo, you can use: git subtree push -prefix=child1 master Use subtree to add the children repos as two folders on the parent repo # In the parent repo If the children repo updated on the remote and you want to get the latest changes from the remotes, you can use: git submodule update -remoteĢ. When you make/commit changes the two children repo and want to push the changes to the remote of the children repo separately, you can use: git submodule foreach "git push" Add the two children repositories as submodules for the parent repo # In the parent repo There are some options can help for your situation: submodules and So it doesn't need to merge back into the parent. When you treat the two repos as the children repo, the code will be exist in the parent repo. Git working mechanism is quite different from TFVC.
0 Comments
Leave a Reply. |