New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.gitconfig not copied to remote container #6810
Comments
The says |
I tested it, and the issue only occurred in the More specifically:
It seems that what settings did VSCode make for the image? I am a rookie in this respect. |
We need to check why the file is there and if we can remove it from that particular image. |
OK, keep me posted. |
I found that using |
I had the same issue. One work-around is to add this to devcontainer.json:
This seems to both have the host ~/.gitconfig copied over and the workspace directory added to git safe.directory. I think it would be useful if the vs code remote extension automatically added the |
Isolated the issue: #7628 |
Confirmed that this (now) happens when using Using |
Confirming this works. I was looking for exactly this issue. I was using a postCreateCommand to add the workspace as a safe directory as explained a few posts above. Please either add this to the containers by default or highlight the issue in the documentation. |
The local |
Confirmed, I had to use |
For me I'm using WSL2 on Windows, .gitconfig was not copied from Windows, I found out it copies it from the base Linux distro for WSL2 so I had the add the settings there so it get copied to every devcontainer I build, Shouldn't it be copied from Windows? |
Same issue here, by simply uncommenting the default content from node image |
Running into the same issue when adding git-lfs feature during the vscode open folder in remote container set-up phase. Very annoying and I don't remember having issues like these in the past... 😕 I.e. need LFS support in a data science container // devcontainer.json
"features": {
// ...
"ghcr.io/devcontainers/features/git-lfs:1": {},
// ...
}, For now installing git lfs manually via postCreateCommand // devcontainer.json
// ...
// Use 'postCreateCommand' to run commands after the container is created.
// Installing git lfs support manually via postCreateCommand to get around this bug
// https://github.com/microsoft/vscode-remote-release/issues/6810#issuecomment-1672300822
"postCreateCommand": "sudo apt update && sudo apt install git-lfs",
// ... |
Can confirm postCreateCommand breaks the gitconfig. Good i found this forum. |
The solution seems to be moving anything from |
I feel ya @tomerh2001 . Seems like the containers internal git setup is moves around in the life cycle through iterations. When in doubt, do it as late as possible. That said Life Cycle
|
I am experiencing the same issue regarding the gitconfig as @D1no and I have isolated git lfs as the culprit.
Without git fls:
With git-lfs either installed with a devcontainer feature or with
|
When running it from |
@chrmarti for now the workaround that works: |
Changed the implementation to check if the existing gitconfig in the container has only |
What's the best way to verify this? I tried with stable + installing git lfs in the Dockerfile, but I can't repro. |
Seeing it with the following config: {
"name": "Ubuntu",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/git-lfs:1": {}
},
"remoteUser": "root"
} Without the fix the |
Steps to Reproduce:
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: