Update cheatsheets

This commit is contained in:
ivuorinen
2026-03-11 00:24:37 +00:00
parent 4d37f773c5
commit 78c884f69c
8 changed files with 147 additions and 13 deletions

View File

@@ -8,6 +8,10 @@ source: https://github.com/tldr-pages/tldr.git
> Manage multiple working trees attached to the same repository.
> More information: <https://git-scm.com/docs/git-worktree>.
- Add a new worktree directory for a branch with the same name (created if missing):
`git worktree add {{branch}}`
- Create a new directory with the specified branch checked out into it:
`git worktree add {{path/to/directory}} {{branch}}`
@@ -16,10 +20,18 @@ source: https://github.com/tldr-pages/tldr.git
`git worktree add {{path/to/directory}} -b {{new_branch}}`
- List all the working directories attached to this repository:
- List all the working directories (including the primary one):
`git worktree list`
- Remove a worktree (after deleting worktree directory):
- Move an existing worktree to a new location:
`git worktree move {{path/to/worktree}} {{new/path}}`
- Remove a worktree directory and its metadata (only if it has no uncommitted changes):
`git worktree remove {{path/to/worktree}}`
- Remove metadata for a worktree directory that's been manually deleted:
`git worktree prune`