Hello David. Unfortunately not all packages that are available from GitHub and other sources work out-of-the-box on all platforms. Some do, for sure, but often they need to be ported to a given platform, such as z/OS. We have posted some rudimentary porting instructions here:
https://www.ibm.com/docs/en/sdk-go-zos/1.16?topic=porting-applications-zos. I took a quick look at git-lfs, and noted the following steps that would need to be taken to get this ported (there may be others, but these are the ones I caught on a first look):
First, the dependency
github.com/olekukonko/ts needs to be ported. It uses a raw syscall that isn't supported on z/OS. To port it, I got the code, added a !zos build tag to ts_other.go and ts_x.go, then created a ts_zos.go based on ts_solaris.go (put in a build tag and changed TIOCGWINSZ to syscall.TIOCGWINSZ). I use "go mod edit -replace" on the git-lfs go.mod file to point to the location of my updated packages. Sometimes I have to do "go mod init" on those packages if they don't have a go.mod file. There is another issue --- git-lfs is using int32 for file mode instead of uint32 -- this has to be changed in several places, the reason being that on z/OS it truly is a uint32. I also found that github/mattn/go-isatty had to have it's go.mod file updated to use "latest' for x/sys/unix. So, as I said, this is what a cursory look told me - there may be other things that need to be done to finish the porting of git-lfs. If you follow through with these steps you can get a working git-lfs on z/OS. I hope that helps. ...Bill------------------------------
Bill O'Farrell
------------------------------