Encoding of the files you store in Git is a different matter.
First of all, the files that you commit to Git need not necessarily be EBCDIC, even if they come from data sets. You probably copy data set members to USS filesystem to store them in Git, and vice versa. It's possible to translate the files between EBCDIC and ASCII as you copy them, but this depends on the tools you use. For example, the
command in USS would do it like this:
# copy to USS
cp -O c=ISO8859-1 "//'MY.DATA.SET(MEMBER)'" ascii-file.txt
# copy back to a data set
cp -O u ascii-file.txt "//'MY.DATA.SET(MEMBER)'"
Then, even if your files in USS are EBCDIC, you can tell Git to convert them from EBCDIC to the encoding used by the repo (which is usually UTF-8, but it depends). Use the
for that. Please refer to Git for z/OS Release Notes for more details. You can find them by logging in to the Rocket Community portal
, selecting the category z/OpenSource
on the left panel, and entering 'Git' in the filter field on the right.
Please note that Git 2.14.4 is outdated. The most recent version of Git is 2.26.2, and there are important differences between these two versions in how they handle file encodings. You might want to consider upgrading to 2.26 now so that you don't need to migrate your repositories later. Git 2.26 is only available via Miniconda
Another important thing to note is that our tools require automatic character conversion to be enabled. The variables I listed in my previous post need to be always active; otherwise file tags and encodings won't work properly.