git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] doc/git-config: simplify "override" advice for FILES section

From
Jeff King <peff@peff.net>
Date
Jul 14, 2021, 21:38 UTC
Message-ID
<YO9ZU4nO7YOASAHn@coredump.intra.peff.net>
In-Reply-To
<YO9YyTZdU4WadYGg@coredump.intra.peff.net>

At the end of the FILES section, we indicate that you can override the regular lookup rules with --global, etc. But:

  - we're missing the --local option
  - we point to GIT_CONFIG instead of --file, but the latter has much
    better documentation
  - we're vague about how the overrides work; the actual option
    descriptions are much better here

So let's just mention the names and point people back to the OPTIONS section. We could perhaps even delete this paragraph entirely, but the presence of the names may give people reading FILES a clue about where to look for more information.

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/git-config.txt | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 30186812a8..e30edf99c6 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -71,6 +71,7 @@ codes are:
 
 On success, the command returns the exit code 0.
 
+[[OPTIONS]]
 OPTIONS
 -------
 
@@ -331,11 +332,9 @@ All writing options will per default write to the repository specific
 configuration file. Note that this also affects options like `--replace-all`
 and `--unset`. *'git config' will only ever change one file at a time*.
 
-You can override these rules either by command-line options or by environment
-variables. The `--global`, `--system` and `--worktree` options will limit
-the file used to the global, system-wide or per-worktree file respectively.
-The `GIT_CONFIG` environment variable has a similar effect, but you
-can specify any filename you want.
+You can override these rules using the `--global`, `--system`,
+`--local`, `--worktree`, and `--file` command-line options; see
+<<OPTIONS>> above.
 
 
 ENVIRONMENT
-- 
2.32.0.689.gbb74d99cdd
Previous: Jeff KingNext: Taylor Blau
Message 15 of 16 in “Bug report: GIT_CONFIG and user.email/name”
  1. German LashevichJul 14, 2021
  2. Jeff KingJul 14, 2021
  3. German LashevichJul 14, 2021
  4. Junio C HamanoJul 14, 2021
  5. Jeff KingJul 14, 2021
  6. 1/3 doc/git-config: explain --file instead of referring to GIT_CONFIGJeff King, Jul 14, 2021
  7. Taylor BlauJul 14, 2021
  8. Jeff KingJul 14, 2021
  9. Taylor BlauJul 14, 2021
  10. Martin ÅgrenJul 20, 2021
  11. Jeff KingJul 20, 2021
  12. Jeff KingJul 20, 2021
  13. Junio C HamanoJul 20, 2021
  14. 2/3 doc/git-config: clarify GIT_CONFIG environment variableJeff King, Jul 14, 2021
  15. 3/3 doc/git-config: simplify "override" advice for FILES sectionJeff King, Jul 14, 2021
  16. Taylor BlauJul 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.