logoalt Hacker News

amlutotoday at 11:40 AM2 repliesview on HN

I want a variant of this where I make a worktree that has no ability to push anywhere including its parent. Instead the parent worktree pulls from it automatically. That way I can run some sandboxed workflow that might arbitrarily corrupt the work tree, possibly overwriting everything in it and symlinked from it, without losing data.


Replies

gcrtoday at 1:11 PM

Don’t you just want a clone in that case?

Normal_gaussiantoday at 12:17 PM

The easy way to do this is to create a worktree and then just run it in some form of sandbox - e.g. a Docker container.

In the worktree there is no .git directory, just a .git file which has a single line: "gitdir: <path to gitdir>".

If your sandbox doesn't have access to the gitdir, you're golden.

show 1 reply