mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-03 20:55:14 +00:00
Update cheatsheets
This commit is contained in:
@@ -5,25 +5,25 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# git subtree
|
||||
|
||||
> Manage project dependencies as subprojects.
|
||||
> Merge subtrees together or split repository into subtrees.
|
||||
> More information: <https://manned.org/git-subtree>.
|
||||
|
||||
- Add a Git repository as a subtree:
|
||||
- Add a Git repository as a subtree and squash the commits together:
|
||||
|
||||
`git subtree add {{[-P|--prefix]}} {{path/to/directory}}/ --squash {{repository_url}} {{branch_name}}`
|
||||
`git subtree add {{[-P|--prefix]}} {{path/to/directory}} --squash {{repository_url}} {{branch_name}}`
|
||||
|
||||
- Update subtree repository to its latest commit:
|
||||
|
||||
`git subtree pull {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{branch_name}}`
|
||||
`git subtree pull {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{branch_name}}`
|
||||
|
||||
- Merge recent changes up to the latest subtree commit into the subtree:
|
||||
|
||||
`git subtree merge {{[-P|--prefix]}} {{path/to/directory}}/ --squash {{repository_url}} {{branch_name}}`
|
||||
`git subtree merge {{[-P|--prefix]}} {{path/to/directory}} --squash {{repository_url}} {{branch_name}}`
|
||||
|
||||
- Push commits to a subtree repository:
|
||||
|
||||
`git subtree push {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{branch_name}}`
|
||||
`git subtree push {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{branch_name}}`
|
||||
|
||||
- Extract a new project history from the history of a subtree:
|
||||
|
||||
`git subtree split {{[-P|--prefix]}} {{path/to/directory}}/ {{repository_url}} {{[-b|--branch]}} {{branch_name}}`
|
||||
`git subtree split {{[-P|--prefix]}} {{path/to/directory}} {{repository_url}} {{[-b|--branch]}} {{branch_name}}`
|
||||
|
||||
Reference in New Issue
Block a user