Re: "fatal: Not a git repository" issued during 'make' from source code
- From
Todd Zullinger <tmz@pobox.com>
- Date
- Aug 12, 2023, 00:54 UTC
- Message-ID
- <ZNbYNxEfPYAB3ILb@pobox.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 gitThe 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