←back to thread

128 points nvader | 6 comments | | HN request time: 0.793s | source | bottom
1. donatj ◴[] No.46192531[source]
I found worktrees unnecessarily painful in Git with little advantage over just having two copies of the repo.

Your far better off just having a clone of your primary repo, and have your primary repo as a local remote. Both can have a remote for GitHub and a separate remote for each other.

replies(3): >>46193828 #>>46194649 #>>46195465 #
2. dylanowen ◴[] No.46193828[source]
I use work trees so my prototype can be open while I build my final code, but I never thought of local remotes! That'll be so much easier!
3. loeg ◴[] No.46194649[source]
It's very useful when your repos are a significant fraction of disk space.
replies(1): >>46203045 #
4. actinium226 ◴[] No.46195465[source]
Genuinely curious, what did you find painful about it? A while back I found it annoying that I'd get errors when cleaning out my branches because they were checked out in a worktree I'd forgotten about, but git now highlights branches checked out in worktrees and has done so for a while.
5. sph ◴[] No.46203045[source]
Given that hard drives are in the terabytes range, which repos are you checking out in the 250+ GB ranges?

How many git users have this problem, really?

replies(1): >>46207890 #
6. loeg ◴[] No.46207890{3}[source]
It was the primary repo at my job at the time. Decades of history, migrated from SVN. Probably some ill-advised large binary blobs committed at one point or another.

Surely it's a tiny fraction of git repos, if not users. But if it's a problem you have, worktrees are very useful.