Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 631 Bytes

README.md

File metadata and controls

22 lines (14 loc) · 631 Bytes

play

Subtrees

Adding a subtree

git subtree add --prefix {local directory being pulled into} {remote repo URL} {remote branch} --squash

For example: git subtree add --prefix subtreeDirectory [email protected]:smilee/subtreeDirectory.git main --squash will clone [email protected]:smilee/subtreeDirectory.git into the 'subtreeDirectory' directory.

Adding the subtree as a remote

git remote add -f subtreeDirectory [email protected]:smilee/subtreeDirectory.git

Fetch new subtree commits

git fetch subtreeDirectory main
git subtree pull --prefix subtreeDirectory subtreeDirectory main --squash