Member-only story
Auto Git Config for VS Code Remote Container Development
Stop running git config every time you clone a repository
The remote extension that Visual Studio Code provides makes developing inside a Docker container more convenient than ever.
Git config is not part of the container definition
However, during my usage, I found configuring Git identities a bit annoying since every time a container is built or re-built, I need to the following to be able to commit changes:
We can automate with local environment variables
The naive solution is to run the commands as part of the Dockerfile, but we don’t necessarily want to do that because (a) it exposes the name and email to the internet and (b) people will step each other on the toes if the repository has multiple contributors.
The more practical solution is to keep it local. For example, as environment variables.