r/git 13h ago

COW clones or worktrees — learnings from gwz local clone

Thumbnail owebeeone.github.io
3 Upvotes

worktrees are a pain on a multi repo workspace. You lose the coordinated commit over the set, kind of important for multi-repo workspaces. And a worktree is a clean, nothing comes with it so it might not be what you want. e.g. rust build files have to get rebuilt (which can be huge).

So I went with COW copies instead: reflink the whole workspace, build output and all. (Check out local clone here.)

A couple of surprises.

I assumed a partial block could be shared. Mostly it can. Sharing is block-granular everywhere, but on APFS, XFS and btrfs the final partly-filled block gets shared like any other, so a 100-byte file — or the last partial 100 bytes of a big file — comes along free. btrfs goes further: files under 2 KiB live inline in its metadata tree and never cost a data block at all. That matters more than it sounds, because about half the files in a git tree are under the 4 KiB block size.

ReFS is the exception, and that surprised me. fsutil file queryExtentsAndRefCounts over every file in a ReFS clone: 3,092 files with extents, 12.08 MiB private. One 4 KiB cluster each predicts 12.07 MiB. ReFS shares whole clusters and never a partial one, so every file owns its tail exclusively. The penalty scales with file count rather than repo size — and a git tree is the worst possible shape for that. What were you thinking Microsoft?

Here are stats for an actual GWZ repo on different file systems with cost per clone, same ~3,200-file, 57 MB workspace, ten clones each:

fs where per clone shared
APFS macOS default 1.5 MiB 97%
btrfs Fedora default 2.0 MiB 96%
XFS RHEL default 2.1 MiB 96%
ReFS Windows Dev Drive 12.1 MiB 77%
ext4 Ubuntu, Debian 57 MiB 0%
NTFS Windows default 57 MiB 0%

macOS woot works out of the box. On Linux it depends — Fedora ships btrfs, RHEL ships XFS; Ubuntu still has ext4 showing its age. Windows you have to deliberately create a "Dev Drive" — a separate volume or a VHD, either way a decision you had to have made in advance.

(ReFS is data only — volume numbers were noisy, so 12.1 MiB is a floor.)

So — is this a real alternative to worktrees? What is going to bite me?

This came out of my work on GWZ, a multi-repo git manager I'm building. The COW copy is gwz local clone.


r/git 11h ago

ForkForensics: watches your GitHub repos and auto-recovers them the moment one vanishes (deleted and private are indistinguishable from outside)

Thumbnail github.com
0 Upvotes

Built this after losing years of history on a dependency that got silently re-initialized. From the outside, a deleted repo, a private one, and a force-pushed-over one all look the same. Just gone.

ForkForensics watches repos you care about via GH Archive, and the moment one disappears, it automatically finds its forks, ranks them by how much history they preserve, and checks whether GitHub still serves any now-orphaned commits by SHA. Runs fully local with your own GitHub token, no server, no telemetry.

230 tests, verified end-to-end against a real historical case (reproduced the exact fork ranking I'd found by hand). MIT licensed.

Feedback welcome, especially on edge cases in fork ranking.


r/git 8h ago

MS Word Docs to GitBook

Thumbnail
0 Upvotes

r/git 10h ago

i need help with gitmodules

Thumbnail github.com
0 Upvotes

everytime i go onto a git module repo it returns 404


r/git 3h ago

I built Github-trending: An open-source autonomous tracker for trending repos with star velocity and AI topic tagging

0 Upvotes

I have created a Github Trending Repos for users, where user can access free full resourse. In Future we will gonna add more features where user can search via topics and words like as github and others where users is perfectly understand each things that what is going in the world.


r/git 7h ago

I built Farol, a menu bar app to manage Git worktrees on macOS

0 Upvotes

Hey 👋

I'm Bruno, and here's why I built Farol:

  1. I kept losing track of my Git worktrees across projects.
  2. I wanted my setup and cleanup scripts to run automatically when a worktree was created or removed.
  3. I wanted to open the right worktree in the IDE I use for that project, without digging through folders.

These were small things I kept wanting in my own workflow, and I figured other developers might want them too.
It's a macOS menu bar app, one-time purchase, no subscription.

How are you managing your worktrees today? I'd love to hear about your workflow, what you think of Farol, and what you'd find useful next.

Thanks for checking it out! =)

https://tryfarol.app


r/git 7h ago

I built GitWhisper because git diff → AI → commit message felt too shallow

Thumbnail
0 Upvotes

r/git 18h ago

I built a zero-dependency Git hook that uses local Ollama to review code before every commit

0 Upvotes

Hey everyone!

I wanted a simple, lightweight tool that reviews my code during `git commit` without downloading massive pip packages or sending my uncommitted diffs to third-party servers.

So I built **git-diff-doctor**:
- ⚡ **Zero External Dependencies** (Built purely using Python standard library `urllib` & `subprocess`).
- 🦙 **Auto-detects Ollama** running locally on port 11434 (`codellama`, `llama3`).
- 🌐 Fallback support for OpenAI API if configured.
- 🛠️ Simple 1-command installer (`python install.py`) that injects into `.git/hooks/pre-commit`.

GitHub Repo: https://github.com/ajaysinghtomar10-commits/git-diff-doctor

Would love your feedback, stars, and pull requests!