4 ms·
For all the use cases I can think of, git worktree could be used to simulate this without any fuse dependency.
by computerfriend 3y ago
For all the use cases I can think of, git worktree could be used to simulate this without any fuse dependency.
- 112233 3y agoI'd like to use specific git tree object as a lowerdir for overlayfs mount, preferrably without requiring root. Do you have anything in mind for that?
- rwbhn 3y agoTIL. Thx!
- lloydatkinson 3y agoDoes worktree allow checking out the same branch but at different commits?
- matrss 3y agoNo, because a branch is a (re-assignable) name for some commit and cannot point at different commits while in the same repository at the same time. A "branch but at different commits" simply makes no sense. You can however create a worktree with a detached HEAD pointing at any commit. By default it seems to create a branch for each worktree.
- SpaceNugget 3y agoSomewhat pedantic but relevant. A branch is a single commit. There aren't different commits _in_ a branch to checkout. Regardless, if you are asking whether you can check out commit that doesn't have a branch pointing at it, yes you can. You can have a work tree for every commit in your repository if you like.
- glandium 3y agoYou can have multiple work trees for the same commit, for that matter, as long as they are the same branch (so with different branches pointing at the same commit, or detached heads)
- gpderetta 3y agoto be even more pedantic, a branch is a (named) pointer to a commit. You can have multiple names pointing to that commit.
- withinboredom 3y agoI did exactly this and use it as a "file system adapter" on my WordPress installation (to handle uploads/media). I tried to submit it as a plugin but they said "no" because I can't use "git" in the name -- and fuck that. So, I'm the only person on earth that does this (AFAIK).
- corobo 3y agoDo you have this plugin available anywhere at all? I can't say it'd fit my workflow or anything without knowing more (so don't go out of your way!) but I'm very intrigued in to how it works