Anyspheres Dev Container Extension doesn’t automatically copy .gitconfig like VS Code does

Hi,

When using Dev Containers in VS Code, the local ~/.gitconfig is automatically copied into the container. This allows Git inside the container to use my user settings seamlessly.

This behavior is described in the official documentation:

However, when using the Dev Container extension in Cursor (provided by Anysphere), this automatic copying doesn’t seem to happen. As a result, Git inside the container doesn’t pick up my user configuration.

Currently, I’m working around this issue by manually adding the following mounts setting to devcontainer.json:

"mounts": [
  "source=${env:HOME}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached"
]

It works, but it would be much more convenient if Cursor supported the same automatic behavior as VS Code.

Could you please consider supporting this feature?

Hi @Koizumi_Ryo, thanks for sharing this issue and the workaround. We’ll look into adding this feature directly into the devcontainers extension.

1 Like