# git init fails because of includeIf configuration

2 messages from 2024-06-28 to 2024-06-28. Participants: Mushegh Khachatryan, Junio C Hamano.
Thread: https://gitlist.dev/t/61694

## Mushegh Khachatryan, 2024-06-28 15:29

Subject: git init fails because of includeIf configuration
Message-ID: <0b92381d-b21f-4d3a-8e68-ad9977a8b45d@gmail.com>
URL: https://gitlist.dev/e/0b92381d-b21f-4d3a-8e68-ad9977a8b45d%40gmail.com

```
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

I have a section of configuration for specific branch in my ~/.gitconfig 
file. It looks like this

ˋˋˋ
[includeIf "onbranch:other"]
         path=~/.gitconfig-other
ˋˋˋ

In ~/.gitconfig-other I have this (the values are changed)

ˋˋˋ
[user]
     email = myemail@email.com
     name = My Name
     signingkey = KEYID

[commit]
     gpgsign = true

[credential]
     username = username
ˋˋˋ

I ran `git init` in empty directory.

What did you expect to happen? (Expected behavior)

Initialize repository with or without includeIf configuration section.

What happened instead? (Actual behavior)

ˋˋˋ
$ git init
BUG: refs.c:2123: reference backend is unknown
zsh: IOT instruction (core dumped)  git init
ˋˋˋ

What's different between what you expected and what actually happened?

I have expected to initialize a new repository but got an error message.

Anything else you want to add:

I ended up commenting includeIf section in my .gitconfig file, 
initialize repository then uncomment that section and use git as usual.
The problem might be related only to `git init`.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.45.2
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.6.34-1-lts #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024 
14:45:31 +0000 x86_64
compiler info: gnuc: 14.1
libc info: glibc: 2.39
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
not run from a git repository - no hooks to show


```

## Junio C Hamano, 2024-06-28 19:40

Subject: Re: git init fails because of includeIf configuration
Message-ID: <xmqqseww26w5.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqseww26w5.fsf%40gitster.g
In-Reply-To: <0b92381d-b21f-4d3a-8e68-ad9977a8b45d@gmail.com>

```
Mushegh Khachatryan <mushegh.khachatryan20@gmail.com> writes:

> $ git init
> BUG: refs.c:2123: reference backend is unknown
> zsh: IOT instruction (core dumped)  git init

Thanks for a report.  

Is this the same issue that was reported some time ago and corrected
in 407997c1 (setup: fix bug with "includeIf.onbranch" when
initializing dir, 2024-05-22), I wonder.  

You can try 'git' built from a recent tip of 'master' [*] to see if
it is the same issue.  Anything that is not older than 7b0defb3 (The
tenth batch, 2024-06-03) should has the fix 407997c1 (setup: fix bug
with "includeIf.onbranch" when initializing dir, 2024-05-22).



```
