# "fatal: Not a git repository" issued during 'make' from source code

21 messages from 2023-08-11 to 2023-08-16. Participants: Mun Johl, rsbecker@nexbridge.com, Junio C Hamano, Todd Zullinger.
Thread: https://gitlist.dev/t/60106

## Mun Johl, 2023-08-11 19:57

Subject: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB8289FF1D6BAC59833D922BA89C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB8289FF1D6BAC59833D922BA89C10A%40SJ0PR04MB8289.namprd04.prod.outlook.com

```
Hi,

I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run 'make prefix=/usr/local all doc', I get the following error:

fatal: Not a git repository (or any parent up to mount point /tools)

Which I infer means that I need to do the build within a git repo.  Is that correct?  Or have I missed some basic step in the build process?

Thank you,

-- 
Mun

```

## rsbecker@nexbridge.com, 2023-08-11 20:18

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <034501d9cc91$069bd360$13d37a20$@nexbridge.com>
URL: https://gitlist.dev/e/034501d9cc91%24069bd360%2413d37a20%24%40nexbridge.com
In-Reply-To: <SJ0PR04MB8289FF1D6BAC59833D922BA89C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
'make
>prefix=/usr/local all doc', I get the following error:
>
>fatal: Not a git repository (or any parent up to mount point /tools)
>
>Which I infer means that I need to do the build within a git repo.  Is that
correct?  Or
>have I missed some basic step in the build process?

Yes, you must be in the cloned git repository in order to run the build.
--Randall


```

## Mun Johl, 2023-08-11 20:22

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB8289D45EE7A495B0ED7F69CD9C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB8289D45EE7A495B0ED7F69CD9C10A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <034501d9cc91$069bd360$13d37a20$@nexbridge.com>

```
Hi Randall,

Thank you for your quick reply.

I'm just wondering... Can I "trick" the compilation process by simply creating a .git directory where I am running 'make'?

Thanks again and best regards,

-- 
Mun

> -----Original Message-----
> From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
> Sent: Friday, August 11, 2023 1:19 PM
> To: Mun Johl <Mun.Johl@wdc.com>; git@vger.kernel.org
> Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
> 
> CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the
> sender and know that the content is safe.
> 
> 
> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
> >I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
> 'make
> >prefix=/usr/local all doc', I get the following error:
> >
> >fatal: Not a git repository (or any parent up to mount point /tools)
> >
> >Which I infer means that I need to do the build within a git repo.  Is that
> correct?  Or
> >have I missed some basic step in the build process?
> 
> Yes, you must be in the cloned git repository in order to run the build.
> --Randall


```

## Mun Johl, 2023-08-11 20:26

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB82893B315F130DCF181D78F49C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB82893B315F130DCF181D78F49C10A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <SJ0PR04MB8289D45EE7A495B0ED7F69CD9C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
Hi,

Sorry for the additional reply--I should have mentioned that we don't have a git repo yet.  I am just trying to get things setup so that we can create a proper repo and migrate our data.

Best regards,

-- 
Mun

> -----Original Message-----
> From: Mun Johl <Mun.Johl@wdc.com>
> Sent: Friday, August 11, 2023 1:23 PM
> To: rsbecker@nexbridge.com; git@vger.kernel.org
> Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
> 
> Hi Randall,
> 
> Thank you for your quick reply.
> 
> I'm just wondering... Can I "trick" the compilation process by simply creating a .git directory where I am running 'make'?
> 
> Thanks again and best regards,
> 
> --
> Mun
> 
> > -----Original Message-----
> > From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
> > Sent: Friday, August 11, 2023 1:19 PM
> > To: Mun Johl <Mun.Johl@wdc.com>; git@vger.kernel.org
> > Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
> >
> > CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the
> > sender and know that the content is safe.
> >
> >
> > On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
> > >I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
> > 'make
> > >prefix=/usr/local all doc', I get the following error:
> > >
> > >fatal: Not a git repository (or any parent up to mount point /tools)
> > >
> > >Which I infer means that I need to do the build within a git repo.  Is that
> > correct?  Or
> > >have I missed some basic step in the build process?
> >
> > Yes, you must be in the cloned git repository in order to run the build.
> > --Randall


```

## Junio C Hamano, 2023-08-11 20:39

Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <xmqqr0o9qpon.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqr0o9qpon.fsf%40gitster.g
In-Reply-To: <034501d9cc91$069bd360$13d37a20$@nexbridge.com>

```
<rsbecker@nexbridge.com> writes:

> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
> 'make
>>prefix=/usr/local all doc', I get the following error:
>>
>>fatal: Not a git repository (or any parent up to mount point /tools)
>>
>>Which I infer means that I need to do the build within a git repo.  Is that
> correct?  Or
>>have I missed some basic step in the build process?
>
> Yes, you must be in the cloned git repository in order to run the build.

Shouldn't we be able to build out of a tarball?

```

## rsbecker@nexbridge.com, 2023-08-11 20:41

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <034c01d9cc94$30c14960$9243dc20$@nexbridge.com>
URL: https://gitlist.dev/e/034c01d9cc94%2430c14960%249243dc20%24%40nexbridge.com
In-Reply-To: <SJ0PR04MB82893B315F130DCF181D78F49C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
On Friday, August 11, 2023 4:26 PM, Mon Johl wrote:
>Sorry for the additional reply--I should have mentioned that we don't have
a git repo
>yet.  I am just trying to get things setup so that we can create a proper
repo and
>migrate our data.

Please consult this page:
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

>> -----Original Message-----
>> From: Mun Johl <Mun.Johl@wdc.com>
>> Sent: Friday, August 11, 2023 1:23 PM
>> To: rsbecker@nexbridge.com; git@vger.kernel.org
>> Subject: RE: "fatal: Not a git repository" issued during 'make' from
>> source code
>>
>> Hi Randall,
>>
>> Thank you for your quick reply.
>>
>> I'm just wondering... Can I "trick" the compilation process by simply
creating a .git
>directory where I am running 'make'?
>>
>> Thanks again and best regards,
>>
>> --
>> Mun
>>
>> > -----Original Message-----
>> > From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
>> > Sent: Friday, August 11, 2023 1:19 PM
>> > To: Mun Johl <Mun.Johl@wdc.com>; git@vger.kernel.org
>> > Subject: RE: "fatal: Not a git repository" issued during 'make' from
>> > source code
>> >
>> > CAUTION: This email originated from outside of Western Digital. Do
>> > not click on links or open attachments unless you recognize the sender
and know
>that the content is safe.
>> >
>> >
>> > On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>> > >I am new to git and am trying to compile git-2.41.0 on RHEL7.  When
>> > >I run
>> > 'make
>> > >prefix=/usr/local all doc', I get the following error:
>> > >
>> > >fatal: Not a git repository (or any parent up to mount point
>> > >/tools)
>> > >
>> > >Which I infer means that I need to do the build within a git repo.
>> > >Is that
>> > correct?  Or
>> > >have I missed some basic step in the build process?
>> >
>> > Yes, you must be in the cloned git repository in order to run the
build.
>> > --Randall


```

## Junio C Hamano, 2023-08-11 20:44

Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <xmqqmsyxqpg7.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqmsyxqpg7.fsf%40gitster.g
In-Reply-To: <xmqqr0o9qpon.fsf@gitster.g>

```
Junio C Hamano <gitster@pobox.com> writes:

> <rsbecker@nexbridge.com> writes:
>
>> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
>> 'make
>>>prefix=/usr/local all doc', I get the following error:
>>>
>>>fatal: Not a git repository (or any parent up to mount point /tools)
>>>
>>>Which I infer means that I need to do the build within a git repo.  Is that
>> correct?  Or
>>>have I missed some basic step in the build process?
>>
>> Yes, you must be in the cloned git repository in order to run the build.
>
> Shouldn't we be able to build out of a tarball?

In other words,

    $ mkdir -p /var/tmp/x
    $ cd /var/tmp/x
    $ wget http://www.kernel.org/pub/software/scm/git/testing/git-2.42.0.rc1.tar.xz
    $ tar xf git-2.42.0.rc1.tar.xz
    $ cd git-2.42.0.rc1
    $ make prefix=/var/tmp/local all doc
    $ sudo make prefix=/var/tmp/local install

is what I just did to make sure that a build from our tarball extract
does not require a git repository (it would be a bug to require one,
as it would make it impossible to bootstrap).

```

## rsbecker@nexbridge.com, 2023-08-11 20:46

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <034d01d9cc94$df9db0e0$9ed912a0$@nexbridge.com>
URL: https://gitlist.dev/e/034d01d9cc94%24df9db0e0%249ed912a0%24%40nexbridge.com
In-Reply-To: <xmqqr0o9qpon.fsf@gitster.g>

```
On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
>Subject: Re: "fatal: Not a git repository" issued during 'make' from source
code
>
><rsbecker@nexbridge.com> writes:
>
>> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
>> 'make
>>>prefix=/usr/local all doc', I get the following error:
>>>
>>>fatal: Not a git repository (or any parent up to mount point /tools)
>>>
>>>Which I infer means that I need to do the build within a git repo.  Is
that
>> correct?  Or
>>>have I missed some basic step in the build process?
>>
>> Yes, you must be in the cloned git repository in order to run the build.
>
>Shouldn't we be able to build out of a tarball?

I don't get the impression he started with a tarball, so subsequently sent
the doc ref for that. Using just "make" is not sufficient from a tarball.


```

## Mun Johl, 2023-08-11 21:15

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB82892A7EB350531DBE4701BA9C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB82892A7EB350531DBE4701BA9C10A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <034d01d9cc94$df9db0e0$9ed912a0$@nexbridge.com>

```
Hi Junio and rsbecker,

Please see my comments below.

> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
> >Subject: Re: "fatal: Not a git repository" issued during 'make' from source
> code
> >
> ><rsbecker@nexbridge.com> writes:
> >
> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When I run
> >> 'make
> >>>prefix=/usr/local all doc', I get the following error:
> >>>
> >>>fatal: Not a git repository (or any parent up to mount point /tools)
> >>>
> >>>Which I infer means that I need to do the build within a git repo.  Is
> that
> >> correct?  Or
> >>>have I missed some basic step in the build process?
> >>
> >> Yes, you must be in the cloned git repository in order to run the build.
> >
> >Shouldn't we be able to build out of a tarball?
> 
> I don't get the impression he started with a tarball, so subsequently sent
> the doc ref for that. Using just "make" is not sufficient from a tarball.[Mun] 

[Mun] Thank you both for the information you have provided!  It turns out I did in fact start from the tar-ball "git-2.41.0.tar.xz" which I downloaded from https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And then I ran the 'make' command.  The process went something like this (basically identical to what Junio documented):

$ tar xf git-2.41.0.tar.xz
$ cd git-2.41.0
$ make prefix=/usr/local all doc

And with the above 'make' command I got the fatal error.

I consulted the Getting-Started-Installing-Git web page that rsbecker referenced, and it basically matches the above--except it uses the 'make configure' process.  So I tried that method as well, but when I got to the 'make all doc info' step, I again got the same fatal error.

Due to some "security precautions", I am unable to use 'git clone https://git.kernel.org/pub/scm/git/git.git' to download the source code.  But I can try to figure out a workaround for that if that is my only option at this point to successfully compile git.

Thank you and regards,

-- 
Mun




```

## Junio C Hamano, 2023-08-11 21:46

Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <xmqqv8dlp80a.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv8dlp80a.fsf%40gitster.g
In-Reply-To: <SJ0PR04MB82892A7EB350531DBE4701BA9C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
Mun Johl <Mun.Johl@wdc.com> writes:

> Due to some "security precautions", I am unable to use 'git clone
> https://git.kernel.org/pub/scm/git/git.git' to download the source
> code.  But I can try to figure out a workaround for that if that
> is my only option at this point to successfully compile git.

If building from tarball extract fails with "not a git repository"
there is something very wrong with what you are doing, and we do not
know what it is.

Most likely cause new folks fail to build from the source is lack of
necessary development libraries and packages that need to be
installed in their build environment, but I am reasonably certain
that if a tarball extract build is failing due to their environment,
build in a clone of the source repository would fail for exactly the
same reason.

```

## rsbecker@nexbridge.com, 2023-08-11 21:46

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <035b01d9cc9d$4c2168d0$e4643a70$@nexbridge.com>
URL: https://gitlist.dev/e/035b01d9cc9d%244c2168d0%24e4643a70%24%40nexbridge.com
In-Reply-To: <SJ0PR04MB82892A7EB350531DBE4701BA9C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
>> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
>> >Subject: Re: "fatal: Not a git repository" issued during 'make' from
>> >source
>> code
>> >
>> ><rsbecker@nexbridge.com> writes:
>> >
>> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When
>> >>>I run
>> >> 'make
>> >>>prefix=/usr/local all doc', I get the following error:
>> >>>
>> >>>fatal: Not a git repository (or any parent up to mount point
>> >>>/tools)
>> >>>
>> >>>Which I infer means that I need to do the build within a git repo.
>> >>>Is
>> that
>> >> correct?  Or
>> >>>have I missed some basic step in the build process?
>> >>
>> >> Yes, you must be in the cloned git repository in order to run the
build.
>> >
>> >Shouldn't we be able to build out of a tarball?
>>
>> I don't get the impression he started with a tarball, so subsequently
>> sent the doc ref for that. Using just "make" is not sufficient from a
>> tarball.[Mun]
>
>[Mun] Thank you both for the information you have provided!  It turns out I
did in fact
>start from the tar-ball "git-2.41.0.tar.xz" which I downloaded from
>https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And then I ran the
'make'
>command.  The process went something like this (basically identical to what
Junio
>documented):
>
>$ tar xf git-2.41.0.tar.xz
>$ cd git-2.41.0
>$ make prefix=/usr/local all doc
>
>And with the above 'make' command I got the fatal error.
>
>I consulted the Getting-Started-Installing-Git web page that rsbecker
referenced, and
>it basically matches the above--except it uses the 'make configure'
process.  So I tried
>that method as well, but when I got to the 'make all doc info' step, I
again got the
>same fatal error.
>
>Due to some "security precautions", I am unable to use 'git clone
>https://git.kernel.org/pub/scm/git/git.git' to download the source code.
But I can try
>to figure out a workaround for that if that is my only option at this point
to
>successfully compile git.

Did you run 'make configure' before using 'make prefix=/usr/local all doc' ?


```

## Junio C Hamano, 2023-08-11 21:49

Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <xmqqr0o9p7vj.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqr0o9p7vj.fsf%40gitster.g
In-Reply-To: <035b01d9cc9d$4c2168d0$e4643a70$@nexbridge.com>

```
<rsbecker@nexbridge.com> writes:

> Did you run 'make configure' before using 'make prefix=/usr/local all doc' ?

A tarball release ships with configure (built out of configure.in)
included, so that should not be necessary.


```

## rsbecker@nexbridge.com, 2023-08-11 21:51

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <036801d9cc9d$fa5c3920$ef14ab60$@nexbridge.com>
URL: https://gitlist.dev/e/036801d9cc9d%24fa5c3920%24ef14ab60%24%40nexbridge.com
In-Reply-To: <xmqqr0o9p7vj.fsf@gitster.g>

```


>-----Original Message-----
>From: Junio C Hamano <gitster@pobox.com>
On Friday, August 11, 2023 5:49 PM, Junio C Hamano wrote:
>To: rsbecker@nexbridge.com
>Cc: 'Mun Johl' <Mun.Johl@wdc.com>; git@vger.kernel.org
>Subject: Re: "fatal: Not a git repository" issued during 'make' from source
code
>
><rsbecker@nexbridge.com> writes:
>
>> Did you run 'make configure' before using 'make prefix=/usr/local all
doc' ?
>
>A tarball release ships with configure (built out of configure.in)
included, so that
>should not be necessary.

Thanks. I don't usually build from a tarball. However, the OP did not
indicate that configure was run either.


```

## Todd Zullinger, 2023-08-12 00:54

Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <ZNbYNxEfPYAB3ILb@pobox.com>
URL: https://gitlist.dev/e/ZNbYNxEfPYAB3ILb%40pobox.com
In-Reply-To: <SJ0PR04MB8289FF1D6BAC59833D922BA89C10A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
Hi,

Mun Johl wrote:
> I am new to git and am trying to compile git-2.41.0 on RHEL7.

This isn't a direct answer to the question (which Randall
and Junio have covered well), but if you're interested, I
build git-2.41.0 for RHEL/CentOS 7 (as well as newer
RHEL/Rocky/Alma and Fedora release) in the Fedora Copr
("Community projects"):

    https://copr.fedorainfracloud.org/coprs/g/git-maint/git/

I currently maintain the git package in Fedora and try to
ensure it always builds for all supported RHEL releases¹.

For RHEL/CentOS 7, the steps to install would be:

    yum install yum-plugin-copr
    yum copr enable @git-maint/git
    yum install git

The upside is that it's a current git build packaged the
same as the RHEL package.  The downside is that it updates
the RHEL package, which may not be acceptable in your
environment.

It's certainly a big jump from 1.8.3.1 to 2.41.0.  I had
forgotten how ancient the RHEL 7 git package was. :)

Alternately, building a git package for RHEL 7 from the
current Fedora git package is another option, if you'd
rather have an rpm to install on multiple hosts.

¹ I may not continue this due to Red Hat's recent decision
  to restrict access to RHEL source code, unfortunately.

-- 
Todd

```

## Mun Johl, 2023-08-12 05:30

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB8289EB7CF0F2EF1803925D929C11A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB8289EB7CF0F2EF1803925D929C11A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <xmqqv8dlp80a.fsf@gitster.g>

```
Hi Junio,

> -----Original Message-----
> From: Junio C Hamano <gitster@pobox.com>
> Sent: Friday, August 11, 2023 2:46 PM
> To: Mun Johl <Mun.Johl@wdc.com>
> Cc: rsbecker@nexbridge.com; git@vger.kernel.org
> Subject: Re: "fatal: Not a git repository" issued during 'make' from source code
> 
> CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the
> sender and know that the content is safe.
> 
> 
> Mun Johl <Mun.Johl@wdc.com> writes:
> 
> > Due to some "security precautions", I am unable to use 'git clone
> > https://git.kernel.org/pub/scm/git/git.git' to download the source
> > code.  But I can try to figure out a workaround for that if that
> > is my only option at this point to successfully compile git.
> 
> If building from tarball extract fails with "not a git repository"
> there is something very wrong with what you are doing, and we do not
> know what it is.
> 
> Most likely cause new folks fail to build from the source is lack of
> necessary development libraries and packages that need to be
> installed in their build environment, but I am reasonably certain
> that if a tarball extract build is failing due to their environment,
> build in a clone of the source repository would fail for exactly the
> same reason.

[Mun] Good point.  I'm certain I don't have all of the requisite packages.  I was expecting to see errors about missing packages, but was thrown off by the fatal error.  I will go back and look closely at the output from 'make' and see if I see any errors prior to the fatal error.

Thank you and regards,

-- 
Mun

```

## Mun Johl, 2023-08-12 05:32

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB82897032646F100BCC9001669C11A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB82897032646F100BCC9001669C11A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <035b01d9cc9d$4c2168d0$e4643a70$@nexbridge.com>

```
Hi rsbecker,

> -----Original Message-----
> From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
> Sent: Friday, August 11, 2023 2:46 PM
> To: Mun Johl <Mun.Johl@wdc.com>; 'Junio C Hamano' <gitster@pobox.com>
> Cc: git@vger.kernel.org
> Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
> 
> CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the
> sender and know that the content is safe.
> 
> 
> On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
> >> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
> >> >Subject: Re: "fatal: Not a git repository" issued during 'make' from
> >> >source
> >> code
> >> >
> >> ><rsbecker@nexbridge.com> writes:
> >> >
> >> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
> >> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.  When
> >> >>>I run
> >> >> 'make
> >> >>>prefix=/usr/local all doc', I get the following error:
> >> >>>
> >> >>>fatal: Not a git repository (or any parent up to mount point
> >> >>>/tools)
> >> >>>
> >> >>>Which I infer means that I need to do the build within a git repo.
> >> >>>Is
> >> that
> >> >> correct?  Or
> >> >>>have I missed some basic step in the build process?
> >> >>
> >> >> Yes, you must be in the cloned git repository in order to run the
> build.
> >> >
> >> >Shouldn't we be able to build out of a tarball?
> >>
> >> I don't get the impression he started with a tarball, so subsequently
> >> sent the doc ref for that. Using just "make" is not sufficient from a
> >> tarball.[Mun]
> >
> >[Mun] Thank you both for the information you have provided!  It turns out I
> did in fact
> >start from the tar-ball "git-2.41.0.tar.xz" which I downloaded from
> >https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And then I ran the
> 'make'
> >command.  The process went something like this (basically identical to what
> Junio
> >documented):
> >
> >$ tar xf git-2.41.0.tar.xz
> >$ cd git-2.41.0
> >$ make prefix=/usr/local all doc
> >
> >And with the above 'make' command I got the fatal error.
> >
> >I consulted the Getting-Started-Installing-Git web page that rsbecker
> referenced, and
> >it basically matches the above--except it uses the 'make configure'
> process.  So I tried
> >that method as well, but when I got to the 'make all doc info' step, I
> again got the
> >same fatal error.
> >
> >Due to some "security precautions", I am unable to use 'git clone
> >https://git.kernel.org/pub/scm/git/git.git' to download the source code.
> But I can try
> >to figure out a workaround for that if that is my only option at this point
> to
> >successfully compile git.
> 
> Did you run 'make configure' before using 'make prefix=/usr/local all doc' ?

[Mun] My apologies for not providing that data previously: Yes, I did run 'make configure' prior to 'make prefix=/usr/local all doc'.

Regards,

-- 
Mun


```

## Mun Johl, 2023-08-12 05:38

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB8289E60CA76DF65C17A79DF49C11A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB8289E60CA76DF65C17A79DF49C11A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <ZNbYNxEfPYAB3ILb@pobox.com>

```
Hi Todd,

> Hi,
> 
> Mun Johl wrote:
> > I am new to git and am trying to compile git-2.41.0 on RHEL7.
> 
> This isn't a direct answer to the question (which Randall
> and Junio have covered well), but if you're interested, I
> build git-2.41.0 for RHEL/CentOS 7 (as well as newer
> RHEL/Rocky/Alma and Fedora release) in the Fedora Copr
> ("Community projects"):
> 
>     https://copr.fedorainfracloud.org/coprs/g/git-maint/git/
> 
> I currently maintain the git package in Fedora and try to
> ensure it always builds for all supported RHEL releases¹.
> 
> For RHEL/CentOS 7, the steps to install would be:
> 
>     yum install yum-plugin-copr
>     yum copr enable @git-maint/git
>     yum install git
> 
> The upside is that it's a current git build packaged the
> same as the RHEL package.  The downside is that it updates
> the RHEL package, which may not be acceptable in your
> environment.
> 
> It's certainly a big jump from 1.8.3.1 to 2.41.0.  I had
> forgotten how ancient the RHEL 7 git package was. :)
> 
> Alternately, building a git package for RHEL 7 from the
> current Fedora git package is another option, if you'd
> rather have an rpm to install on multiple hosts.
> 
> ¹ I may not continue this due to Red Hat's recent decision
>   to restrict access to RHEL source code, unfortunately.[Mun] 

[Mun] Thank you for the link and the additional information!  I am going to try a little more to see if I can get git compiled from source code; but if I get blocked I may download your build :)  It's nice to have options.

Thank you and best regards,

-- 
Mun


```

## rsbecker@nexbridge.com, 2023-08-14 14:54

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <045201d9cebf$4f96d260$eec47720$@nexbridge.com>
URL: https://gitlist.dev/e/045201d9cebf%244f96d260%24eec47720%24%40nexbridge.com
In-Reply-To: <SJ0PR04MB82897032646F100BCC9001669C11A@SJ0PR04MB8289.namprd04.prod.outlook.com>

```
Rather than asking one line at a time, can you provide the complete log,
input and output of the attempted operation, including the download and tar?
Thanks,
Randall

>-----Original Message-----
>From: Mun Johl <Mun.Johl@wdc.com>
>Sent: Saturday, August 12, 2023 1:33 AM
>To: rsbecker@nexbridge.com; 'Junio C Hamano' <gitster@pobox.com>
>Cc: git@vger.kernel.org
>Subject: RE: "fatal: Not a git repository" issued during 'make' from source
code
>
>Hi rsbecker,
>
>> -----Original Message-----
>> From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
>> Sent: Friday, August 11, 2023 2:46 PM
>> To: Mun Johl <Mun.Johl@wdc.com>; 'Junio C Hamano' <gitster@pobox.com>
>> Cc: git@vger.kernel.org
>> Subject: RE: "fatal: Not a git repository" issued during 'make' from
>> source code
>>
>> CAUTION: This email originated from outside of Western Digital. Do not
>> click on links or open attachments unless you recognize the sender and
know that
>the content is safe.
>>
>>
>> On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
>> >> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
>> >> >Subject: Re: "fatal: Not a git repository" issued during 'make'
>> >> >from source
>> >> code
>> >> >
>> >> ><rsbecker@nexbridge.com> writes:
>> >> >
>> >> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>> >> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.
>> >> >>>When I run
>> >> >> 'make
>> >> >>>prefix=/usr/local all doc', I get the following error:
>> >> >>>
>> >> >>>fatal: Not a git repository (or any parent up to mount point
>> >> >>>/tools)
>> >> >>>
>> >> >>>Which I infer means that I need to do the build within a git repo.
>> >> >>>Is
>> >> that
>> >> >> correct?  Or
>> >> >>>have I missed some basic step in the build process?
>> >> >>
>> >> >> Yes, you must be in the cloned git repository in order to run
>> >> >> the
>> build.
>> >> >
>> >> >Shouldn't we be able to build out of a tarball?
>> >>
>> >> I don't get the impression he started with a tarball, so
>> >> subsequently sent the doc ref for that. Using just "make" is not
>> >> sufficient from a tarball.[Mun]
>> >
>> >[Mun] Thank you both for the information you have provided!  It turns
>> >out I
>> did in fact
>> >start from the tar-ball "git-2.41.0.tar.xz" which I downloaded from
>> >https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And then I
>> >ran the
>> 'make'
>> >command.  The process went something like this (basically identical
>> >to what
>> Junio
>> >documented):
>> >
>> >$ tar xf git-2.41.0.tar.xz
>> >$ cd git-2.41.0
>> >$ make prefix=/usr/local all doc
>> >
>> >And with the above 'make' command I got the fatal error.
>> >
>> >I consulted the Getting-Started-Installing-Git web page that rsbecker
>> referenced, and
>> >it basically matches the above--except it uses the 'make configure'
>> process.  So I tried
>> >that method as well, but when I got to the 'make all doc info' step,
>> >I
>> again got the
>> >same fatal error.
>> >
>> >Due to some "security precautions", I am unable to use 'git clone
>> >https://git.kernel.org/pub/scm/git/git.git' to download the source code.
>> But I can try
>> >to figure out a workaround for that if that is my only option at this
>> >point
>> to
>> >successfully compile git.
>>
>> Did you run 'make configure' before using 'make prefix=/usr/local all
doc' ?
>
>[Mun] My apologies for not providing that data previously: Yes, I did run
'make
>configure' prior to 'make prefix=/usr/local all doc'.
>
>Regards,
>
>--
>Mun


```

## Mun Johl, 2023-08-15 01:14

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <PH0PR04MB8295B799ED69C91BBCCCED3B9C14A@PH0PR04MB8295.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/PH0PR04MB8295B799ED69C91BBCCCED3B9C14A%40PH0PR04MB8295.namprd04.prod.outlook.com
In-Reply-To: <045201d9cebf$4f96d260$eec47720$@nexbridge.com>

```
Hi Randall,

> Rather than asking one line at a time, can you provide the complete log,
> input and output of the attempted operation, including the download and tar?[Mun] 

[Mun] I downloaded "git-2.41.0.tar.xz" from https://mirrors.edge.kernel.org/pub/software/scm/git/ .  Then I ran:

$ unxz git-2.41.0.tar.xz
$ tar xvf git-2.41.0.tar
$ cd git-2.41.0
$ make configure

The output of the above command was:

GIT_VERSION = 2.41.0
    GEN configure

$ ./configure --prefix=/usr/local |& tee configure_20230814a_RHEL7.out     // Output is attached as "configure_20230814a_RHEL7.out"
$ make all doc |& tee make_20230814a_RHEL7.out      // Output is attached as "make_20230814a_RHEL7.out"

I went over the output files but didn't notice anything to cause a fatal error; although, I do have some missing pkgs that I will work on retrieving and installing.  Remember, due to corporate security settings, I cannot simply to a 'yum install' of missing pkgs.

Thank you and regards,

-- 
Mun

> Thanks,
> Randall
> 
> >-----Original Message-----
> >From: Mun Johl <Mun.Johl@wdc.com>
> >Sent: Saturday, August 12, 2023 1:33 AM
> >To: rsbecker@nexbridge.com; 'Junio C Hamano' <gitster@pobox.com>
> >Cc: git@vger.kernel.org
> >Subject: RE: "fatal: Not a git repository" issued during 'make' from source
> code
> >
> >Hi rsbecker,
> >
> >> -----Original Message-----
> >> From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
> >> Sent: Friday, August 11, 2023 2:46 PM
> >> To: Mun Johl <Mun.Johl@wdc.com>; 'Junio C Hamano' <gitster@pobox.com>
> >> Cc: git@vger.kernel.org
> >> Subject: RE: "fatal: Not a git repository" issued during 'make' from
> >> source code
> >>
> >> CAUTION: This email originated from outside of Western Digital. Do not
> >> click on links or open attachments unless you recognize the sender and
> know that
> >the content is safe.
> >>
> >>
> >> On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
> >> >> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
> >> >> >Subject: Re: "fatal: Not a git repository" issued during 'make'
> >> >> >from source
> >> >> code
> >> >> >
> >> >> ><rsbecker@nexbridge.com> writes:
> >> >> >
> >> >> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
> >> >> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.
> >> >> >>>When I run
> >> >> >> 'make
> >> >> >>>prefix=/usr/local all doc', I get the following error:
> >> >> >>>
> >> >> >>>fatal: Not a git repository (or any parent up to mount point
> >> >> >>>/tools)
> >> >> >>>
> >> >> >>>Which I infer means that I need to do the build within a git repo.
> >> >> >>>Is
> >> >> that
> >> >> >> correct?  Or
> >> >> >>>have I missed some basic step in the build process?
> >> >> >>
> >> >> >> Yes, you must be in the cloned git repository in order to run
> >> >> >> the
> >> build.
> >> >> >
> >> >> >Shouldn't we be able to build out of a tarball?
> >> >>
> >> >> I don't get the impression he started with a tarball, so
> >> >> subsequently sent the doc ref for that. Using just "make" is not
> >> >> sufficient from a tarball.[Mun]
> >> >
> >> >[Mun] Thank you both for the information you have provided!  It turns
> >> >out I
> >> did in fact
> >> >start from the tar-ball "git-2.41.0.tar.xz" which I downloaded from
> >> >https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And then I
> >> >ran the
> >> 'make'
> >> >command.  The process went something like this (basically identical
> >> >to what
> >> Junio
> >> >documented):
> >> >
> >> >$ tar xf git-2.41.0.tar.xz
> >> >$ cd git-2.41.0
> >> >$ make prefix=/usr/local all doc
> >> >
> >> >And with the above 'make' command I got the fatal error.
> >> >
> >> >I consulted the Getting-Started-Installing-Git web page that rsbecker
> >> referenced, and
> >> >it basically matches the above--except it uses the 'make configure'
> >> process.  So I tried
> >> >that method as well, but when I got to the 'make all doc info' step,
> >> >I
> >> again got the
> >> >same fatal error.
> >> >
> >> >Due to some "security precautions", I am unable to use 'git clone
> >> >https://git.kernel.org/pub/scm/git/git.git' to download the source code.
> >> But I can try
> >> >to figure out a workaround for that if that is my only option at this
> >> >point
> >> to
> >> >successfully compile git.
> >>
> >> Did you run 'make configure' before using 'make prefix=/usr/local all
> doc' ?
> >
> >[Mun] My apologies for not providing that data previously: Yes, I did run
> 'make
> >configure' prior to 'make prefix=/usr/local all doc'.
> >
> >Regards,
> >
> >--
> >Mun


```

## rsbecker@nexbridge.com, 2023-08-15 13:51

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <001001d9cf7f$96a62f50$c3f28df0$@nexbridge.com>
URL: https://gitlist.dev/e/001001d9cf7f%2496a62f50%24c3f28df0%24%40nexbridge.com
In-Reply-To: <PH0PR04MB8295B799ED69C91BBCCCED3B9C14A@PH0PR04MB8295.namprd04.prod.outlook.com>

```
On Monday, August 14, 2023 9:15 PM, Mun Johl wrote:
>> Rather than asking one line at a time, can you provide the complete
>> log, input and output of the attempted operation, including the
>> download and tar?[Mun]
>
>[Mun] I downloaded "git-2.41.0.tar.xz" from
>https://mirrors.edge.kernel.org/pub/software/scm/git/ .  Then I ran:
>
>$ unxz git-2.41.0.tar.xz
>$ tar xvf git-2.41.0.tar
>$ cd git-2.41.0
>$ make configure
>
>The output of the above command was:
>
>GIT_VERSION = 2.41.0
>    GEN configure
>
>$ ./configure --prefix=/usr/local |& tee configure_20230814a_RHEL7.out
// Output
>is attached as "configure_20230814a_RHEL7.out"
>$ make all doc |& tee make_20230814a_RHEL7.out      // Output is attached
as
>"make_20230814a_RHEL7.out"
>
>I went over the output files but didn't notice anything to cause a fatal
error; although,
>I do have some missing pkgs that I will work on retrieving and installing.
Remember,
>due to corporate security settings, I cannot simply to a 'yum install' of
missing pkgs.
>
>Thank you and regards,
>
>--
>Mun
>
>> Thanks,
>> Randall
>>
>> >-----Original Message-----
>> >From: Mun Johl <Mun.Johl@wdc.com>
>> >Sent: Saturday, August 12, 2023 1:33 AM
>> >To: rsbecker@nexbridge.com; 'Junio C Hamano' <gitster@pobox.com>
>> >Cc: git@vger.kernel.org
>> >Subject: RE: "fatal: Not a git repository" issued during 'make' from
>> >source
>> code
>> >
>> >Hi rsbecker,
>> >
>> >> -----Original Message-----
>> >> From: rsbecker@nexbridge.com <rsbecker@nexbridge.com>
>> >> Sent: Friday, August 11, 2023 2:46 PM
>> >> To: Mun Johl <Mun.Johl@wdc.com>; 'Junio C Hamano'
>> >> <gitster@pobox.com>
>> >> Cc: git@vger.kernel.org
>> >> Subject: RE: "fatal: Not a git repository" issued during 'make'
>> >> from source code
>> >>
>> >> CAUTION: This email originated from outside of Western Digital. Do
>> >> not click on links or open attachments unless you recognize the
>> >> sender and
>> know that
>> >the content is safe.
>> >>
>> >>
>> >> On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
>> >> >> On Friday, August 11, 2023 4:39 PM, Junio C Hamano wrote:
>> >> >> >Subject: Re: "fatal: Not a git repository" issued during 'make'
>> >> >> >from source
>> >> >> code
>> >> >> >
>> >> >> ><rsbecker@nexbridge.com> writes:
>> >> >> >
>> >> >> >> On Friday, August 11, 2023 3:57 PM, Mun Johl wrote:
>> >> >> >>>I am new to git and am trying to compile git-2.41.0 on RHEL7.
>> >> >> >>>When I run
>> >> >> >> 'make
>> >> >> >>>prefix=/usr/local all doc', I get the following error:
>> >> >> >>>
>> >> >> >>>fatal: Not a git repository (or any parent up to mount point
>> >> >> >>>/tools)
>> >> >> >>>
>> >> >> >>>Which I infer means that I need to do the build within a git
repo.
>> >> >> >>>Is
>> >> >> that
>> >> >> >> correct?  Or
>> >> >> >>>have I missed some basic step in the build process?
>> >> >> >>
>> >> >> >> Yes, you must be in the cloned git repository in order to run
>> >> >> >> the
>> >> build.
>> >> >> >
>> >> >> >Shouldn't we be able to build out of a tarball?
>> >> >>
>> >> >> I don't get the impression he started with a tarball, so
>> >> >> subsequently sent the doc ref for that. Using just "make" is not
>> >> >> sufficient from a tarball.[Mun]
>> >> >
>> >> >[Mun] Thank you both for the information you have provided!  It
>> >> >turns out I
>> >> did in fact
>> >> >start from the tar-ball "git-2.41.0.tar.xz" which I downloaded
>> >> >from https://mirrors.edge.kernel.org/pub/software/scm/git/ .  And
>> >> >then I ran the
>> >> 'make'
>> >> >command.  The process went something like this (basically
>> >> >identical to what
>> >> Junio
>> >> >documented):
>> >> >
>> >> >$ tar xf git-2.41.0.tar.xz
>> >> >$ cd git-2.41.0
>> >> >$ make prefix=/usr/local all doc
>> >> >
>> >> >And with the above 'make' command I got the fatal error.
>> >> >
>> >> >I consulted the Getting-Started-Installing-Git web page that
>> >> >rsbecker
>> >> referenced, and
>> >> >it basically matches the above--except it uses the 'make configure'
>> >> process.  So I tried
>> >> >that method as well, but when I got to the 'make all doc info'
>> >> >step, I
>> >> again got the
>> >> >same fatal error.
>> >> >
>> >> >Due to some "security precautions", I am unable to use 'git clone
>> >> >https://git.kernel.org/pub/scm/git/git.git' to download the source
code.
>> >> But I can try
>> >> >to figure out a workaround for that if that is my only option at
>> >> >this point
>> >> to
>> >> >successfully compile git.
>> >>
>> >> Did you run 'make configure' before using 'make prefix=/usr/local
>> >> all
>> doc' ?
>> >
>> >[Mun] My apologies for not providing that data previously: Yes, I did
>> >run
>> 'make
>> >configure' prior to 'make prefix=/usr/local all doc'.

So this looks just like it is dependencies (like asciidoc), but the
procedure for configuring and running the git make looks correct. Yes?

--Randall


```

## Mun Johl, 2023-08-16 00:19

Subject: RE: "fatal: Not a git repository" issued during 'make' from source code
Message-ID: <SJ0PR04MB8289EAD6BDB5308778B89E979C15A@SJ0PR04MB8289.namprd04.prod.outlook.com>
URL: https://gitlist.dev/e/SJ0PR04MB8289EAD6BDB5308778B89E979C15A%40SJ0PR04MB8289.namprd04.prod.outlook.com
In-Reply-To: <001001d9cf7f$96a62f50$c3f28df0$@nexbridge.com>

```
Hi all,

... Text Deleted ...

> >> >[Mun] My apologies for not providing that data previously: Yes, I did
> >> >run
> >> 'make
> >> >configure' prior to 'make prefix=/usr/local all doc'.
> 
> So this looks just like it is dependencies (like asciidoc), but the
> procedure for configuring and running the git make looks correct. Yes?

[Mun] Yes.

As it turns out, I was able to get the missing RPMs onto our server.  I reran the build commands and I was able to successfully build 'git' and the documentation.  Oddly, I still got the same "fatal:" messages in the output of 'make'--but apparently the issue was not truly fatal (thankfully).

Now I will move on to migrating our SVN repo to git (but apparently I am missing some Perl modules).

I want to thank all of you for being so helpful!

Best regards,

-- 
Mun


> 
> --Randall


```
