3 ms·
I just found out today about git worktree[1], and I think it's a very powerful feature more people should know about, but it seems used less than it could. Bas
by RealityVoid 7y ago
I just found out today about git worktree[1], and I think it's a very powerful feature more people should know about, but it seems used less than it could.
Basically, you can do a working copy of the git environment without pulling the repo again, so you have only one .git folder.
A godsend if you, like me, work on gigantic repos that build unbearably slowly and want to be able to use multiple instances of the same repo at the same time.
[1] https://git-scm.com/docs/git-worktree https://git-scm.com/docs/git-worktree
- jomar 7y agoCompared to the previous technique of creating a new separate local clone for unrelated simultaneous work on a project, it's also glorious when it comes time to clean up and delete no-longer-needed extra working directories. After `make clean` and `git status --ignored` shows nothing worth preserving, you can delete the worktree (via `git worktree remove`) with impunity. No more paranoid checking that there is no valuable work stashed or hiding in other branches before typing `rm -rf`, as those are shared with the main worktree so won't be lost.