Skip to content

Instantly share code, notes, and snippets.

@Seasawher
Created August 23, 2023 11:54
Show Gist options
  • Save Seasawher/8b71a71f3712b57e3e051ee941626512 to your computer and use it in GitHub Desktop.
Save Seasawher/8b71a71f3712b57e3e051ee941626512 to your computer and use it in GitHub Desktop.
Devcontainer でコンテナを立ち上げたときに,コミットしようとしたら git のユーザ名とEメールアドレスが設定されていないというエラー

Devcontainer でコンテナを立ち上げたときに,コミットしようとしたら git のユーザ名とEメールアドレスが設定されていないというエラー

原因がよくわからないので解決方法だけ述べます.

postCreateCommand コマンドで git config --global --add safe.directory ${containerWorkspaceFolder} を設定していたのですが, これがよくなかったようです.

postStartCommand に移動させたところ,解決しました.

@Seasawher
Copy link
Author

おそらく,コンテナの中の git config をホストの git config がコピーされるよりも早く修正するといけないのだと思う.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment