harbor run -t LiteCoder/build-git-from-sourceharbor download LiteCoder/build-git-from-sourceCompile and install Git from source code with a custom configuration, installing it to /opt/git-custom with PCRE support and optimized build flags.
Install build dependencies needed for Git compilation (including PCRE library development headers).
Download Git source code: Obtain a stable release of Git source (version 2.40 or later). Extract it to /app/git-source/.
Configure the build with the following options:
/opt/git-customgit grep regex functionalityCompile Git using make with:
-O2-Wl,-O1Install Git to /opt/git-custom. After installation, the following must exist:
/opt/git-custom/bin/gitCreate a symbolic link: Create /usr/local/bin/git-custom pointing to /opt/git-custom/bin/git.
Verification report: Write a JSON report to /app/output.json with the following structure:
{
"git_version": "<output of /opt/git-custom/bin/git --version>",
"install_prefix": "/opt/git-custom",
"pcre_support": true,
"binary_path": "/opt/git-custom/bin/git",
"symlink_path": "/usr/local/bin/git-custom",
"optimization_flags": "-O2",
"linker_flags": "-Wl,-O1",
"test_repo_status": "<output of git-custom init on a test repo>"
}
git_version: The exact string output from running /opt/git-custom/bin/git --version (e.g., "git version 2.47.0")pcre_support: Boolean true if PCRE/PCRE2 is compiled in. Verify by checking that /opt/git-custom/bin/git grep -P does not return an error about missing PCRE support.test_repo_status: Initialize a test repository at /app/test-repo/ using the custom git binary and capture the init output string.Clean up: Remove the downloaded source tarball and extracted source directory under /app/git-source/ after successful installation. The /app/git-source/ directory should not exist when the task is complete.
/app/output.json — JSON verification report as specified above/opt/git-custom/bin/git — working custom-built Git binary/usr/local/bin/git-custom — symbolic link to the custom Git binary/app/test-repo/ — initialized Git repository created with the custom binary