1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00

git-subtree: add page (#4012)

Co-authored-by: Zlatan Vasović <zlatanvasovic@gmail.com>
Co-authored-by: Andrik Albuquerque <andrik.albuquerque@gmail.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
This commit is contained in:
Ein Verne 2020-05-03 20:55:53 +08:00 committed by GitHub
parent 8c7b7c95aa
commit ee05f3f691
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,24 @@
# git subtree
> Tool to manage project dependencies as subprojects.
> More information: <https://manpages.debian.org/testing/git-man/git-subtree.1.en.html>.
- Add a git repository as a subtree:
`git subtree add --prefix={{path/to/directory/}} --squash {{repository_url}} {{master}}`
- Update subtree repository to its latest commit:
`git subtree pull --prefix={{path/to/directory/}} {{repository_url}} {{master}}`
- Merge a subtree repository into master:
`git subtree merge --prefix={{path/to/directory/}} --squash {{repository_url}} {{master}}`
- Push commits to a subtree repository:
`git subtree push --prefix={{path/to/directory/}} {{repository_url}} {{master}}`
- Extract a new project history from the history of a subtree:
`git subtree split --prefix={{path/to/directory/}} {{repository_url}} -b {{branch_name}}`