Skip to main content
​​Hello...
I installed git for the first time in a test mainframe LPAR and I am facing the following issue..
If I disable AUTOCVT and I don't chtag any file and I do manual iconv conversion for each file before git-add (when pushing to a remote server)
iconv -f IBM1047 -t utf-8 Hello.java >Hello3.java
or the opposite after git-clone (after cloning from a remote server) everything works fine.

if I enable AUTOCVT on profile
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
and change tag like this
chtag -t -c IBM-1047 Hello.java
when I git add I get

fatal: can't add "Hello.java": file is tagged, set corresponding zos-working-tree-encoding attribute or reset file tag

on the same folder I have the following .gitattributes tagged as iso8859-1
# The default for text files
*       git-encoding=iso8859-1 zos-working-tree-encoding=ibm-1047
# git's files (which MUST be ASCII)
.gitattributes   git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1
.gitignore       git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1

​​Hello...
I installed git for the first time in a test mainframe LPAR and I am facing the following issue..
If I disable AUTOCVT and I don't chtag any file and I do manual iconv conversion for each file before git-add (when pushing to a remote server)
iconv -f IBM1047 -t utf-8 Hello.java >Hello3.java
or the opposite after git-clone (after cloning from a remote server) everything works fine.

if I enable AUTOCVT on profile
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
and change tag like this
chtag -t -c IBM-1047 Hello.java
when I git add I get

fatal: can't add "Hello.java": file is tagged, set corresponding zos-working-tree-encoding attribute or reset file tag

on the same folder I have the following .gitattributes tagged as iso8859-1
# The default for text files
*       git-encoding=iso8859-1 zos-working-tree-encoding=ibm-1047
# git's files (which MUST be ASCII)
.gitattributes   git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1
.gitignore       git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1

Hi Panagiotis, I guess you are using git 2.26.2 according to the error message. Still I can't reproduce your case in my environment. Could you provide your entire environment using env | sort?
​​Hello...
I installed git for the first time in a test mainframe LPAR and I am facing the following issue..
If I disable AUTOCVT and I don't chtag any file and I do manual iconv conversion for each file before git-add (when pushing to a remote server)
iconv -f IBM1047 -t utf-8 Hello.java >Hello3.java
or the opposite after git-clone (after cloning from a remote server) everything works fine.

if I enable AUTOCVT on profile
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
and change tag like this
chtag -t -c IBM-1047 Hello.java
when I git add I get

fatal: can't add "Hello.java": file is tagged, set corresponding zos-working-tree-encoding attribute or reset file tag

on the same folder I have the following .gitattributes tagged as iso8859-1
# The default for text files
*       git-encoding=iso8859-1 zos-working-tree-encoding=ibm-1047
# git's files (which MUST be ASCII)
.gitattributes   git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1
.gitignore       git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1

Hi again,.i found the problem...i deleted .gitattributes file, i created an empty one ,i tagged it as iso8859-1 first and then wrote it's contents again. And everything worked in that order.I verified everything with git check-attr -a filename...
I have another question if i may... If i want to git push datasets with greek EBCDIC characters should i use zos-working-tree-encoding ibm 875 ?
​​Hello...
I installed git for the first time in a test mainframe LPAR and I am facing the following issue..
If I disable AUTOCVT and I don't chtag any file and I do manual iconv conversion for each file before git-add (when pushing to a remote server)
iconv -f IBM1047 -t utf-8 Hello.java >Hello3.java
or the opposite after git-clone (after cloning from a remote server) everything works fine.

if I enable AUTOCVT on profile
export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
and change tag like this
chtag -t -c IBM-1047 Hello.java
when I git add I get

fatal: can't add "Hello.java": file is tagged, set corresponding zos-working-tree-encoding attribute or reset file tag

on the same folder I have the following .gitattributes tagged as iso8859-1
# The default for text files
*       git-encoding=iso8859-1 zos-working-tree-encoding=ibm-1047
# git's files (which MUST be ASCII)
.gitattributes   git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1
.gitignore       git-encoding=iso8859-1 zos-working-tree-encoding=iso8859-1

Hi Panagiotis,
If you would like to use another encodings, please, check Appendix in the Git documentation (Supported character sets in Git for z/OS 2.26.2) to make sure that the character set is supported.
If you want a file be encoded as EBCDIC on z/OS and as UTF-8 on another platforms, you should you the setting: zos-working-tree-encoding=<EBCDIC_charset>