Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_worktree [2019/02/24 13:40] – [Return to main working tree] rpjday | git_worktree [2019/03/06 08:24] (current) – [Additional issues to cover] rpjday | ||
|---|---|---|---|
| Line 97: | Line 97: | ||
| ==== Remove the worktree ==== | ==== Remove the worktree ==== | ||
| - | If you have no further use for the worktree, remove | + | If you have no further use for the worktree, remove |
| < | < | ||
| $ git worktree remove ../temp | $ git worktree remove ../temp | ||
| - | $ git worktree prune | ||
| $ git branch | $ git branch | ||
| emergency | emergency | ||
| Line 230: | Line 229: | ||
| ==== Make and commit a change in the worktree ==== | ==== Make and commit a change in the worktree ==== | ||
| - | Stage a change: | + | Make a change, and stage it: |
| < | < | ||
| Line 328: | Line 327: | ||
| ==== Remove working tree ==== | ==== Remove working tree ==== | ||
| - | Remove | + | Once you're done with the worktree, remove it and " |
| < | < | ||
| - | $ rm -rf ../temp | + | $ git worktree remove |
| - | </ | + | [rpjday@localhost progit2]$ git worktree list |
| - | + | / | |
| - | Still seems to be there: | + | |
| - | + | ||
| - | < | + | |
| - | $ git worktree list | + | |
| - | / | + | |
| - | / | + | |
| $ | $ | ||
| </ | </ | ||
| - | We need to " | + | Note that the '' |
| < | < | ||
| - | $ git worktree prune | + | $ git branch |
| - | [rpjday@android-a172fe96dd584b41 progit2]$ git worktree list | + | emergency |
| - | / | + | * master |
| - | $ | + | |
| - | </ | + | |
| - | + | ||
| - | But our work that was committed from that working tree is still there in the object store: | + | |
| - | + | ||
| - | < | + | |
| - | $ git show emergency | + | |
| - | commit 6bf829d7e63b1184c73546aa94625849054b1ebc (emergency) | + | |
| - | Author: Robert P. J. Day < | + | |
| - | Date: Tue Feb 6 09:48:48 2018 -0500 | + | |
| - | + | ||
| - | silly change | + | |
| - | + | ||
| - | diff --git a/ | + | |
| - | index d7810fd..0576243 100644 | + | |
| - | --- a/ | + | |
| - | +++ b/ | + | |
| - | @@ -1,4 +1,4 @@ | + | |
| - | -= Pro Git, Second Edition | + | |
| - | += Pro Git, Second Edition (rday) | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| $ | $ | ||
| </ | </ | ||
| - | ===== Additional issues ===== | + | ===== Additional issues |
| * locking and unlocking working trees | * locking and unlocking working trees | ||
| * moving working trees | * moving working trees | ||
| - | | + | * git config |
| - | | + | |
| * config var '' | * config var '' | ||
| * config var '' | * config var '' | ||