2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Dev Container の Copy Git Config が効かなくて困っている人へ

Posted at

原因

Dockerfile の中などで git config をするなどして、コンテナの ~/.gitconfig を先に作ってしまうと、VS Code が config をコピーしてくるのに失敗します。

対処方法

git config コマンドは devcontainer.json の postStartCommand に書けばよいです。
注意: postCreateCommand にではないです。

{
  "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?