Dev container: add git-lfs feature to silence post-checkout warning#31
Merged
Conversation
Codespaces hosts run 'git lfs install --system', which seeds a post-checkout hook into every clone. The python:3.13-bookworm image used by our dev container doesn't ship git-lfs, so every 'git checkout / switch / restore' prints 'This repository is configured for Git LFS but git-lfs was not found on your path.' The repo itself doesn't use LFS, so the warning is cosmetic, but it fires on every git operation and looks like a real failure to new users. Adding the git-lfs dev container feature makes the binary available and the hook becomes a silent no-op.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add the
git-lfsdev container feature so the binary is onPATHinside Codespaces / Dev Containers.Why
In any environment where
git lfs install --systemhas been run on the host (which is the case for the default Codespaces image), git copies apost-checkouthook into every new clone. That hook expectsgit-lfsonPATH. The dev container image (mcr.microsoft.com/devcontainers/python:3.13-bookworm) doesn't shipgit-lfs, so everygit checkout/git switch/git restoreprints:Repo itself does not use LFS (no
.gitattributes, nofilter.lfsconfig, nocore.hookspath) — the warning is purely cosmetic, but it fires on every git operation and looks like a real problem to new users.Deleting
.git/hooks/post-checkoutworks once but the hook comes back on every fresh Codespace / container rebuild. Installing thegit-lfsbinary inside the container is the only fix that survives rebuilds.How
One new entry under
features:"ghcr.io/devcontainers/features/git-lfs:1": {}Adds ~5 s to the first container build and a few MB to the image. No runtime impact.
Verification
.devcontainer/devcontainer.jsononly)git lfs versionreturns a version;git checkoutno longer prints the warningChecklist