Repository navigation
pr-2245/bhushan/worktree-link-shared-files-v1
tagged this
26 Nov 18:25
From: Bhushan Gaikwad <bhushan@alfredscholar.com> Ignored configuration files such as .env often need to remain identical across linked worktrees. Today users must copy them manually or install a post-checkout hook, which is easy to forget and can create divergent local configuration. Add a multi-valued worktree.sharedFile setting. For each configured root-level regular file, worktree add creates an absolute symbolic link from the new worktree to the primary worktree before running the post-checkout hook. Reject nested paths and source symlinks, avoid replacing checkout files, and fail cleanly when symbolic links are unavailable. Signed-off-by: Bhushan Gaikwad <bhushan@alfredscholar.com> Submitted-As: https://lore.kernel.org/git/pull.2245.git.1795717517830.gitgitgadget@gmail.com