From 811addc3919f9b9ec1e838920f1e2d791a1e5595 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Wed, 17 Jan 2024 23:21:37 +0100 Subject: git: add worktree notes --- src/tools/git.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tools/git.md') diff --git a/src/tools/git.md b/src/tools/git.md index fc640f9..eb1f633 100644 --- a/src/tools/git.md +++ b/src/tools/git.md @@ -51,6 +51,7 @@ git branch -d .......... delete local branch with name git checkout ........... switch to branch with name git checkout --track .. start to locally track a remote branch + git branch --unset-upstream .... unset remote tracking branch # Remote @@ -74,6 +75,18 @@ git push origin --tags .... push local tags to origin (or other remote) ``` +## Worktree +Worktrees allow to maintain multiple working trees in the filesystem linked to +the same repository (shared .git folder). +```markdown + git worktree add .............. create a tree at with a new branch + checked out (bname is basename of ) + git worktree add ...... create a tree at from existing + git worktree list .................... list existing work trees + git worktree remove ........... remove work tree + git worktree prune ................... remove stale bookkeeping files +``` + ## Log & Commit History ```markdown git log --oneline ......... shows log in single line per commit -> alias for -- cgit v1.2.3