This guide will show you how to manage your Git configuration in Coder.
Personal git configurations
Coder will create a global Git configuration file located at
all newly created workspaces. Coder will also set the user name and email
address based on the user's Coder account information.
This step occurs before coder/configure
and personalization. This means that you
can use both files to override the default
.gitconfig created by Coder.
If there's already a
.gitconfigfile, Coder will not recreate a default
version when you rebuild a workspace.
We recommend that each Coder user set and modify their personal
file using the ~/personalize script.
Preferences defined using individual
.gitconfig files take precedence over
System and global Git configurations
If you have a set of instructions that apply to your organization as a whole,
you can define and use a system-level Git configuration file. We suggest adding
.gitconfig directly to the image's Dockerfile:
# Add system-level gitconfig COPY ["gitconfig", "/etc/gitconfig"]
System-level git configurations live under
/etc/gitconfig. If this file is
git applies the settings defined to each repository. However, any
Coder user can override system-level settings using global or worktree git
For more information on Git configuration, refer to the official documentation.