microsoft / microsoft/vscode-remote-release

WSL Devcontainer inconsistence between ~/.gitconfig and ~/.config/git/config

Open
#9,937 2 comments 0 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since May 29, 2024.

bug containers
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Issue:

When starting VSCode Devcontainer in WSL, and that linux has git config in ~/.gitconfig, VSCode copies that one to the Devcontainer, and ignores if a c:\Users<username>/.gitconfig exists, resulting in everything working fine.

If instead the linux git config is in ~/.config/git/config when starting VSCode Devcontainer in WSL, it will copy both that one
and the one from c:\ if it exists. to the devcontainer, which ends up merging both, prioritizing windows gitconfig.

Assuming the intent is to prioritize WSL git config if VSCode Devcontainer was started in WSL and such a config exists there, it should not care if its in ~/.gitconfig or ~/.config/git/config when deciding to ignore c:\ config

Environment:

  • VSCode Version: 1.89.1
  • Local OS Version: Windows 11 (Windows_NT x64 10.0.22621)
  • Remote OS Version: Ubuntu 22.04.1 LTS
  • Remote Extension/Connection Type: WSL2

Steps to Reproduce:

  1. In Windows have a config in: c:\Users<username>.gitconfig
  2. In WSL have a config in: ~/.config/git/config (XDG_HOME)
  3. Have no config files in WSL ~/.gitconfig
  4. End result is WSL git config becomes secondary or ignored depending on whats in c:\ or wsl config

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.