|
1 | 1 | ---
|
2 |
| -title: Managing Git configuration |
| 2 | +title: Git configuration |
3 | 3 | description: Learn how to configure Git in Coder.
|
4 | 4 | ---
|
5 | 5 |
|
6 | 6 | This guide will show you how to manage your Git configuration in Coder.
|
7 | 7 |
|
8 | 8 | ## Personal git configurations
|
9 | 9 |
|
10 |
| -Coder will create a global git configuration file located at `~/.gitconfig` in |
11 |
| -all newly created workspaces and set the user name and email address using the |
12 |
| -information associated with the user's Coder account. |
| 10 | +Coder will create a global Git configuration file located at `~/.gitconfig` in |
| 11 | +all newly created workspaces. Coder will also set the user name and email |
| 12 | +address based on the user's Coder account information. |
13 | 13 |
|
14 | 14 | This step occurs before [coder/configure](images/../../../images/configure.md)
|
15 |
| -and [personalization](../../workspaces/personalization.md), which can be used to |
16 |
| -override the default `.gitconfig` created by Coder. If there's already a |
17 |
| -`.gitconfig` file, Coder will not recreate a default version when you rebuild an |
18 |
| -workspace. |
| 15 | +and [personalization](../../workspaces/personalization.md). This means that you |
| 16 | +can use both files to override the default `.gitconfig` created by Coder. |
19 | 17 |
|
20 |
| -We recommend that each Coder user set and modify their personal .gitconfig file |
21 |
| -using the [~/personalize script](../../workspaces/personalization.md). |
| 18 | +> If there's already a `.gitconfig` file, Coder will not recreate a default |
| 19 | +version when you rebuild a workspace. |
22 | 20 |
|
| 21 | +We recommend that each Coder user set and modify their personal `.gitconfig` |
| 22 | +file using the [~/personalize script](../../workspaces/personalization.md). |
23 | 23 | **Preferences defined using individual `.gitconfig` files take precedence over
|
24 | 24 | system-level settings.**
|
25 | 25 |
|
26 |
| -## System and global git configurations |
| 26 | +## System and global Git configurations |
27 | 27 |
|
28 |
| -If you have a set of git configuration instructions that apply to your |
29 |
| -organization as a whole, you can define and use a system-level git |
30 |
| -configuration. We suggest adding the system-level `.gitconfig` directly to the |
31 |
| -image's Dockerfile: |
| 28 | +If you have a set of instructions that apply to your organization as a whole, |
| 29 | +you can define and use a system-level Git configuration file. We suggest adding |
| 30 | +the system-level `.gitconfig` directly to the image's Dockerfile: |
32 | 31 |
|
33 | 32 | ```Dockerfile
|
34 | 33 | # Add system-level gitconfig
|
35 | 34 | COPY ["gitconfig", "/etc/gitconfig"]
|
36 | 35 | ```
|
37 | 36 |
|
38 |
| -As you can see from the example, system-level git configurations live under |
39 |
| -`/etc/gitconfig`. If present, `git` applies the settings to each repository. |
40 |
| -However, any Coder user can override system-level settings using global or |
41 |
| -worktree git configurations. |
| 37 | +System-level git configurations live under `/etc/gitconfig`. If this file is |
| 38 | +present, `git` applies the settings defined to each repository. However, any |
| 39 | +Coder user can override system-level settings using global or worktree git |
| 40 | +configurations. |
42 | 41 |
|
43 |
| -For more information on git configuration, refer to the |
44 |
| -[official documentation](https://git-scm.com/docs/git-config) |
| 42 | +For more information on Git configuration, refer to the [official |
| 43 | +documentation](https://git-scm.com/docs/git-config). |
0 commit comments