0

This will sound really basic to some, but I'm overwhelmed. I need to make a portable version of git for Linux such that a program could run /path/to/folder/git successfully. I assume git has dependencies such that if all I put in the folder was that file, some features wouldn't work.

I found the Linux download page with a link to the latest tarball: git-2.40.0.tar.gz; I've no idea what to do next. I'm guessing there's some compiling to do (how?). I can work with either a Mac or Windows machine.

PS: It's not important that I compile from source if there is an easier but safe way to get the portable folder for Linux git.

Adding Context in case it matters

I actually need the executable in a zip file, within a /bin folder. This is because it will be uploaded to AWS as a Lambda layer. There's a project that did exactly this, but is using an old version of git (see layers.zip in this git repo folder)

As for the relevant Linux version, Amazon says:

you must compile and build these libraries using a Linux development machine so that the binaries are compatible with Amazon Linux

Paolo
  • 21,270
  • 6
  • 38
  • 69
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
  • The lambda layer link looks fine; if you really need a Git version which is not yet available from the official repos, you actually do need to recompile it, probably based on the packaging for the previous version. – tripleee Mar 23 '23 at 06:29
  • https://git-scm.com/download/linux points to https://ius.io/ for getting a recent RPM package from a third-party source. I have not explored this in more detail. – tripleee Mar 23 '23 at 06:32
  • https://stackoverflow.com/questions/41542697/install-3rd-party-libary-on-aws-lambda-execution-environment has some tips for AWS Lambda in particular, though it basically just links to an off-site resource. – tripleee Mar 23 '23 at 06:37
  • If you want to compile from source on a non-Linux platform you might want to explore Docker, which lets you run Amazon Linux in a container. Then just export the compiled binaries from the container. But how exactly to recompile Git for this specific platform is a broad enough topic to require a separate question. – tripleee Mar 23 '23 at 06:40
  • What problem are you trying to solve? Why do you need git in a lambda? – Paolo Mar 23 '23 at 07:35
  • @Paolo yes I'm trying to execute git within a Lambda – BeetleJuice Mar 23 '23 at 17:26
  • Why, what problem are you trying to solve? – Paolo Mar 23 '23 at 17:35
  • @Paolo I'm building a git repo browser for remote repos; I'd like to get a list of all files and directories in a git repo at HEAD without downloading the files. I do that by executing "git clone --depth=1 --filter=blob:none --no-checkout", then executing "git ls-tree" to get the tree entries. My application is written in Go, but I haven't found a good Go library that will handle this for me. – BeetleJuice Mar 24 '23 at 02:47

0 Answers0