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

[PATCH 1/3] doc/git-config: explain --file instead of referring to GIT_CONFIG

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

The explanation for the --file option only refers to GIT_CONFIG. This redirection to an environment variable is confusing, but doubly so because the description of GIT_CONFIG is out of date.

Let's describe --file from scratch, detailing both the reading and writing behavior as we do for other similar options like --system, etc.

Signed-off-by: Jeff King <peff@peff.net>
---
The formatting is a bit clunky to read in the source, but I think it
looks OK in the rendered version. At any rate, it's all taken from the
other options, so if we want to improve it, it would make sense to do so
separately on top.
 Documentation/git-config.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 5cddadafd2..193fef2867 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -143,7 +143,13 @@ See also <<FILES>>.
 
 -f config-file::
 --file config-file::
-	Use the given config file instead of the one specified by GIT_CONFIG.
+	For writing options: write to the specified file rather than the
+	repository `.git/config`.
++
+For reading options: read only from the specified file rather than from all
+avialable files.
++
+See also <<FILES>>.
 
 --blob blob::
 	Similar to `--file` but use the given blob instead of a file. E.g.
-- 
2.32.0.689.gbb74d99cdd
Previous: Jeff KingNext: Taylor Blau
Message 6 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.