From ce1a0365d4601b273eab2c0f8aac01632f0776f0 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Sun, 9 Aug 2020 12:40:54 +0200 Subject: [PATCH] Change /etc/gitconfig -> [path]/etc/gitconfig Closes #506 --- book/01-introduction/sections/first-time-setup.asc | 8 ++++---- book/08-customizing-git/sections/config.asc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index 9e8c27c27..a91688c2a 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -8,7 +8,7 @@ You can also change them at any time by running through the commands again. 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))) These variables can be stored in three different places: -1. `/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories. +1. `[path]/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories. If you pass the option `--system` to `git config`, it reads and writes from this file specifically. Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it. 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: You can force Git to read from and write to this file with the `--local` option, but that is in fact the default. Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly. -Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`. +Each level overrides values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`. On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people). -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. +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. If you are using version 2.x or later of Git for Windows, there is also a system-level config file at `C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and in `C:\ProgramData\Git\config` on Windows Vista and newer. This config file can only be changed by `git config -f ` as an admin. @@ -100,7 +100,7 @@ color.diff=auto ... ---- -You may see keys more than once, because Git reads the same key from different files (`/etc/gitconfig` and `~/.gitconfig`, for example). +You may see keys more than once, because Git reads the same key from different files (`[path]/etc/gitconfig` and `~/.gitconfig`, for example). In this case, Git uses the last value for each unique key it sees. You can also check what Git thinks a specific key's value is by typing `git config `:(((git commands, config))) diff --git a/book/08-customizing-git/sections/config.asc b/book/08-customizing-git/sections/config.asc index 85ffccdf6..207c69da1 100644 --- a/book/08-customizing-git/sections/config.asc +++ b/book/08-customizing-git/sections/config.asc @@ -14,7 +14,7 @@ $ git config --global user.email johndoe@example.com Now you'll learn a few of the more interesting options that you can set in this manner to customize your Git usage. First, a quick review: Git uses a series of configuration files to determine non-default behavior that you may want. -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. +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. If you pass the option `--system` to `git config`, it reads and writes from this file specifically. 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 These values are specific to that single repository, and represent passing the `--local` option to `git config`. If you don't specify which level you want to work with, this is the default. -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. +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. [NOTE] ====