You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/01-introduction/sections/first-time-setup.asc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ You can also change them at any time by running through the commands again.
8
8
Git comes with a tool called `git config` that lets you get and set configuration variables that control all aspects of how Git looks and operates.(((git commands, config)))
9
9
These variables can be stored in three different places:
10
10
11
-
1. `/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories.
11
+
1. `[path]/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories.
12
12
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
13
13
Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.
14
14
2. `~/.gitconfig` or `~/.config/git/config` file: Values specific personally to you, the user.
@@ -17,10 +17,10 @@ These variables can be stored in three different places:
17
17
You can force Git to read from and write to this file with the `--local` option, but that is in fact the default.
18
18
Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly.
19
19
20
-
Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`.
20
+
Each level overrides values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`.
21
21
22
22
On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people).
23
-
It also still looks for `/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
23
+
It also still looks for `[path]/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
24
24
If you are using version 2.x or later of Git for Windows, there is also a system-level config file at
25
25
`C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and in `C:\ProgramData\Git\config` on Windows Vista and newer.
26
26
This config file can only be changed by `git config -f <file>` as an admin.
@@ -112,7 +112,7 @@ color.diff=auto
112
112
...
113
113
----
114
114
115
-
You may see keys more than once, because Git reads the same key from different files (`/etc/gitconfig` and `~/.gitconfig`, for example).
115
+
You may see keys more than once, because Git reads the same key from different files (`[path]/etc/gitconfig` and `~/.gitconfig`, for example).
116
116
In this case, Git uses the last value for each unique key it sees.
117
117
118
118
You can also check what Git thinks a specific key's value is by typing `git config <key>`:(((git commands, config)))
Now you'll learn a few of the more interesting options that you can set in this manner to customize your Git usage.
15
15
16
16
First, a quick review: Git uses a series of configuration files to determine non-default behavior that you may want.
17
-
The first place Git looks for these values is in the system-wide `/etc/gitconfig` file, which contains settings that are applied to every user on the system and all of their repositories.
17
+
The first place Git looks for these values is in the system-wide `[path]/etc/gitconfig` file, which contains settings that are applied to every user on the system and all of their repositories.
18
18
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
19
19
20
20
The next place Git looks is the `~/.gitconfig` (or `~/.config/git/config`) file, which is specific to each user.
@@ -24,7 +24,7 @@ Finally, Git looks for configuration values in the configuration file in the Git
24
24
These values are specific to that single repository, and represent passing the `--local` option to `git config`.
25
25
If you don't specify which level you want to work with, this is the default.
26
26
27
-
Each of these ``levels'' (system, global, local) overwrites values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`, for instance.
27
+
Each of these ``levels'' (system, global, local) overwrites values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`, for instance.
0 commit comments