- Clone this repository.
- Create a new branch on this (
subtree-root
) repository for any changes. - You will need to push changes twice or more (Once to
subtree-root
and another tosubtree-child
and other subtrees)- Commit and Push All Changes to
subtree-root
First. - Push any subtree specific changes a new branch on a subtree (
subtree-child
) repository.git subtree --prefix=<folder_name> push <repository> <branch_name>
git subtree --prefix=subtree_child push https://github.com/ppak10/subtree-child.git enhancement/instructions
- This will push any changes under the
subtree_root/subtree_child
to the newly createdenhancement/instructions
branch in thesubtree_child
repository.
- This will push any changes under the
- Commit and Push All Changes to
- Aim to keep the branches between different repsitories in the same state.
- (i.e.
subtree-root/subtree-child
==subtree-child
formain
branch.)
- (i.e.
- Merge changes in subtree child first, then merge changes in subtree root.
- This should mitigate issues and merge conflicts between multiple developers.
- Changes in
subtree-root/subtree-child
branch should be equal tosubtree-child
repo'smain
branch
- Making changes directly to
main
branch insubtree-child
repo would require a merge.