threads / discuss / 60106

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

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

## tl;dr

21 messages between Aug 11, 2023 and Aug 16, 2023.

replies: 20people: 4as markdown or json

Mun Johl· Aug 11, 2023, 19:57 UTC · lore
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· Aug 11, 2023, 20:18 UTC · re: Mun Johl · lore

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

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
Show 5 quoted lines
>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· Aug 11, 2023, 20:22 UTC · re: rsbecker@nexbridge.com · lore

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
Mun Johl· Aug 11, 2023, 20:26 UTC · re: Mun Johl · lore

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

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
rsbecker@nexbridge.com· Aug 11, 2023, 20:41 UTC · re: Mun Johl · lore

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

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

Show 12 quoted lines
>> -----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
Show 16 quoted lines
>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
Show 18 quoted lines
>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· Aug 11, 2023, 20:39 UTC · re: rsbecker@nexbridge.com · lore

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

<rsbecker@nexbridge.com> writes:
Show 12 quoted lines
> 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?
Junio C Hamano· Aug 11, 2023, 20:44 UTC · re: Junio C Hamano · lore

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

Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> <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· Aug 11, 2023, 20:46 UTC · re: Junio C Hamano · lore

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

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
Show 11 quoted lines
>
><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
Show 6 quoted lines
>> 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· Aug 11, 2023, 21:15 UTC · re: rsbecker@nexbridge.com · lore

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

Hi Junio and rsbecker,
Please see my comments below.
Show 24 quoted lines
> 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· Aug 11, 2023, 21:46 UTC · re: Mun Johl · lore

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

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 Johl· Aug 12, 2023, 05:30 UTC · re: Junio C Hamano · lore

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

Hi Junio,
Show 28 quoted lines
> -----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
rsbecker@nexbridge.com· Aug 11, 2023, 21:46 UTC · re: Mun Johl · lore

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

On Friday, August 11, 2023 5:15 PM, Mon Johl wrote:
Show 23 quoted lines
>> 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.
Show 8 quoted lines
>> >
>> >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
Show 9 quoted lines
>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· Aug 11, 2023, 21:49 UTC · re: rsbecker@nexbridge.com · lore

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.

rsbecker@nexbridge.com· Aug 11, 2023, 21:51 UTC · re: Junio C Hamano · lore

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

>-----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.

Mun Johl· Aug 12, 2023, 05:32 UTC · re: rsbecker@nexbridge.com · lore

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

Hi rsbecker,
Show 74 quoted lines
> -----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· Aug 14, 2023, 14:54 UTC · re: Mun Johl · lore

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

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

Show 6 quoted lines
>-----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
Show 13 quoted lines
>
>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
Show 72 quoted lines
>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
Show 6 quoted lines
>configure' prior to 'make prefix=/usr/local all doc'.
>
>Regards,
>
>--
>Mun
Mun Johl· Aug 15, 2023, 01:14 UTC · re: rsbecker@nexbridge.com · lore

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

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· Aug 15, 2023, 13:51 UTC · re: Mun Johl · lore

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

On Monday, August 14, 2023 9:15 PM, Mun Johl wrote:
Show 18 quoted lines
>> 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.
Show 54 quoted lines
>
>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.
Show 45 quoted lines
>> >> >> >>>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.
Show 14 quoted lines
>> >> 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· Aug 16, 2023, 00:19 UTC · re: rsbecker@nexbridge.com · lore

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

Hi all,
... Text Deleted ...
Show 7 quoted lines
> >> >[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
Todd Zullinger· Aug 12, 2023, 00:54 UTC · re: Mun Johl · lore

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

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· Aug 12, 2023, 05:38 UTC · re: Todd Zullinger · lore

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

Hi Todd,
Show 36 quoted lines
> 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

← back to recent threads