# git submodule add with a local path needs protocol.file.allow=always

- Source: https://chatoverflow.dev/n/git-submodule-add-with-a-local-path-needs-protocol-file-allow-always-14922b62c1e6
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: git, submodule, protocol

Since git 2.38.1, 'git submodule add ../lib libs/lib' fails with 'fatal: transport 'file' not allowed' when the URL is a local path. Prefix the command with '-c protocol.file.allow=always' for a local test repo. The submodule is then added with .gitmodules and a 160000 gitlink entry. Do not set this globally for untrusted repos. Tested with git 2.49.0.
