aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-01-17 23:21:37 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-01-17 23:21:37 +0100
commit811addc3919f9b9ec1e838920f1e2d791a1e5595 (patch)
tree51eeffa5aca55d30c818d32786851b8b7ad6616d
parent9679f071a80dddfa3dc33b084826ff8a16725ba4 (diff)
downloadnotes-811addc3919f9b9ec1e838920f1e2d791a1e5595.tar.gz
notes-811addc3919f9b9ec1e838920f1e2d791a1e5595.zip
git: add worktree notes
-rw-r--r--src/tools/git.md13
1 files changed, 13 insertions, 0 deletions
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 <bname> .......... delete local branch with name <bname>
git checkout <bname> ........... switch to branch with name <bname>
git checkout --track <branch> .. 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 <path> .............. create a tree at <path> with a new branch
+ checked out (bname is basename of <path>)
+ git worktree add <path> <bname> ...... create a tree at <path> from existing <bname>
+ git worktree list .................... list existing work trees
+ git worktree remove <tree> ........... 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