# # Default zGit .gitattributes file specifying that all files are in EBCDIC # # This file is copied to .git/info/attributes during ZINIT # # * zos-working-tree-encoding=ibm-1047 .gitattributes zos-working-tree-encoding=iso8859-1 .gitignore zos-working-tree-encoding=iso8859-1 and the .gitattributes file that looks like this:
# # This file is effectively concatenated after .git/info/attributes # # For this repo the TABLES directory should be processed as Binary, and the # $ACBVERS.TABLES directory should be processed as Binary # TABLES/** binary $ACBVERS.TABLES/** binaryFrom by understanding of git attributes this should tell Git that all files in the TABLES and $ACBVARS.TABLES directory are in binary.
I can successfully issue both the git-add and git-commit to add the files to the repo. However, performing a git-restore of one of the files brings back a file in a totally different format, for example
Before being committed to Git:
BROWSE /u/u700215/zGit-Repositories/U700215/GIT/MAI/TABLES/$SSCAI Line 0000000000 Col 001 132 Command ===> Scroll ===> CSR *********************************************************** Top of Data *****************************************.àTIR:...{..$SSCAI ..Ø.Ìh...-........m.¤...o.".å.BOL .............&..ESEQNBR . SSCAI.EXT.940208.0857.. .. .. .. .......Ø..ì...â............ ..#..I..Ø..&................ ..#..ISPF.AI.CLIST..KT..Knowledge Tool.........Ø..&................ ..#..ISPF.AI.SKELS..TIRE..Creat own TIRS.uilder/370.........Ø..&................ ..#..ISPF.AI.PANELS..TIRR..TIRS Runtime/370....Ø..ç................ ..#..ISPF.PROL.HELP..PROntry .........................ry .................................................... ********************************************************** Bottom of Data ***************************************After performing a git-restore:
BROWSE /u/u700215/zGit-Repositories/U700215/GIT/MAI/TABLES/$SSCAI Line 0000000000 Col 001 132 Command ===> Scroll ===> CSR *********************************************************** Top of Data ****************************************.àTIR:...{..$SSCAI ..Ø.Ìh...-........m.¤...o.".å.BOL .............&..ESEQNBR . ..ä`..ELVL ....äã..EDS ....èÁ..EXKEY ....â...ECMTS ....]å..Ø..ç............. . SSCAI.EXT.940208.0857.. .. .. .. .......Ø..ì...â............ ..#..ISPF.AI.CLIST..ESEC..Expert System Consult........Ø..ì...â........********************************************************** Bottom of Data **************************************They are full of hex characters but they should at least have the same number of lines.
I also noticed that after the git-restore the file's CCSID is still binary but its USS file format has changed to from binary to "not specified".
So I guess I have a few questions:
Are my git attributes set correctly for binary files ?
If they are, I believe this is a problem with Git for z/OS. I have push the commit I made to Github and clone it to my PC. The file on the PC matches byte-to-byte to the file I committed.
Is anyone else managing binary files using Git for z/OS successfully, if yes, what are you doing differently ?
------------------------------
Gary Freestone
Systems Programmer
Kyndryl Inc
Mt Helen VIC AU
------------------------------

And it seems the answer is no.
