Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

.gitconfig file not copied when setting safe.directory via postCreateCommand #1532

Closed
HenrikStanley opened this issue Jul 13, 2022 · 4 comments

Comments

@HenrikStanley
Copy link

  • VSCode Version: 1.69.1
  • Local OS Version: Windows 11 Pro, OS Build 22000.795
  • Local chip architecture: x86
  • Reproduces in: Remote - Containers
  • Name of Dev Container Definition with Issue: Custom Container Image

Using a custom made container image, the VSCode setting for copying the .gitconfig file from the host does not work when editing the .gitconfig file via postCreateCommand.

This seems to be due to the check for existing .gitconfig files happening after running:
git config --global --add safe.directory ${containerWorkspaceFolder}

as part of the postCreateCommand steps.

Steps to Reproduce:

  1. Set Remote › Containers: Copy Git Config setting to true
  2. Set in devcontainer.json git config --global --add safe.directory ${containerWorkspaceFolder}

Suggested solutions:

  • Run the copy of gitconfig from host before postCreateCommand.
  • Add a setting natively in devcontainer.json or the vscode plugin to add add safe.directorys at the appropriate timing after copy from host.
@bamurtaugh
Copy link
Member

Thanks for opening, @HenrikStanley.

@joshspicer @edgonmsft does this sound like a spec issue (so it should be moved to https://github.com/devcontainers/spec)? Or specific to Remote-Containers (so it should be moved to https://github.com/microsoft/vscode-remote-release)?

@edgonmsft
Copy link
Contributor

I think it would be a cli issue

@bamurtaugh
Copy link
Member

Thanks @edgonmsft.

@HenrikStanley if you're still experiencing this, would you be able to open an issue in https://github.com/devcontainers/cli/issues instead? Thanks!

@HenrikStanley
Copy link
Author

@bamurtaugh

I have submitted an issue in the CLI repository and updated the issue a bit to make it clearer.
Thanks for the guidance.

(I will close this issue and leave a link here for the new one):
devcontainers/cli#98

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants