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

Is it possible to use new conditional includes outside of git dir?

From
MSMihails Strasuns <mihails.strasuns@gmail.com>
Date
May 15, 2017, 18:09 UTC
Message-ID
<b18ddd8e-5772-6351-6e49-78c1372077f1@gmail.com>
Hello,

I was very excited to try out new conditional include feature but have quickly found out that it doesn't work with some of my custom scripts because of the following behaviour:

# .gitconfig [includeIf "gitdir:~/work/"] path = ~/.gitconfig.work [user] name1 = Someone

# .gitconfig.work [user] name2 = SomeoneElse $ cd ~/work; git config user.name1 # "Someone" $ cd ~/work ; git config user.name2 # <nothing>

I see that it matches current `git config` documentation - indeed, it mentions only matching on git directory and not arbitrary file path. I wonder though, if this limitation is intentional and what is the rationale behind it?

Thank you, Michael

Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “Is it possible to use new conditional includes outside of git dir?”
  1. Mihails StrasunsMay 15, 2017
  2. Ævar Arnfjörð BjarmasonMay 15, 2017
  3. Mihails StrasunsMay 18, 2017

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.