Skip to main content
Søren Arnvig
Participating Frequently
Dec 8, 2022 8:41 AM UTC

Where should .gitattributes be located ?

I'm cloning from a repository based  on a Windows server with files in UTF-8.
The repository contains files named XXXXXX.pli

I'd like to clone to z/OS with the target codepage IBM-1047, but I cant get it to work
I have placed .gitattributes file in the repository and also in the target work dataset,
but I get no codepage conversion.

Where should .gitattributes be located and are the any other setting there must be switched on/off or set ?

Current .gitattributes looks like this:

# line endings
* text eol=lf
# file encodings
.cpy zos-working-tree-encoding=ibm-1047
.cbl zos-working-tree-encoding=ibm-1047
.bms zos-working-tree-encoding=ibm-1047
.pli zos-working-tree-encoding=ibm-1047
.mfs zos-working-tree-encoding=ibm-1047
.bnd zos-working-tree-encoding=ibm-1047
.lnk zos-working-tree-encoding=ibm-1047
.txt zos-working-tree-encoding=ibm-1047
.groovy zos-working-tree-encoding=ibm-1047
.sh zos-working-tree-encoding=ibm-1047
.properties zos-working-tree-encoding=ibm-1047
.asm zos-working-tree-encoding=ibm-1047
.jcl zos-working-tree-encoding=ibm-1047
.mac zos-working-tree-encoding=ibm-1047
.json zos-working-tree-encoding=utf-8




------------------------------
Søren Arnvig
Specialist IT Drift / Mainframe
Topdanmark Edb II ApS
Ballerup DK
------------------------------

    4 replies

    Lionel Dyck
    Participating Frequently
    Dec 8, 2022 8:49 AM UTC

    I'm cloning from a repository based  on a Windows server with files in UTF-8.
    The repository contains files named XXXXXX.pli

    I'd like to clone to z/OS with the target codepage IBM-1047, but I cant get it to work
    I have placed .gitattributes file in the repository and also in the target work dataset,
    but I get no codepage conversion.

    Where should .gitattributes be located and are the any other setting there must be switched on/off or set ?

    Current .gitattributes looks like this:

    # line endings
    * text eol=lf
    # file encodings
    .cpy zos-working-tree-encoding=ibm-1047
    .cbl zos-working-tree-encoding=ibm-1047
    .bms zos-working-tree-encoding=ibm-1047
    .pli zos-working-tree-encoding=ibm-1047
    .mfs zos-working-tree-encoding=ibm-1047
    .bnd zos-working-tree-encoding=ibm-1047
    .lnk zos-working-tree-encoding=ibm-1047
    .txt zos-working-tree-encoding=ibm-1047
    .groovy zos-working-tree-encoding=ibm-1047
    .sh zos-working-tree-encoding=ibm-1047
    .properties zos-working-tree-encoding=ibm-1047
    .asm zos-working-tree-encoding=ibm-1047
    .jcl zos-working-tree-encoding=ibm-1047
    .mac zos-working-tree-encoding=ibm-1047
    .json zos-working-tree-encoding=utf-8




    ------------------------------
    Søren Arnvig
    Specialist IT Drift / Mainframe
    Topdanmark Edb II ApS
    Ballerup DK
    ------------------------------
    The .gitattributes goes into the 'root' directory of the repository - no different than on any other platform.

    If you want a simple way to use git on z/OS check out https://github.com/zigi

    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------
    Søren Arnvig
    Participating Frequently
    Dec 8, 2022 9:01 AM UTC
    The .gitattributes goes into the 'root' directory of the repository - no different than on any other platform.

    If you want a simple way to use git on z/OS check out https://github.com/zigi

    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------

    Thanks for the swift answer

    I'm not sure what "root" means in this context

    I have the .gitattributes in the main branch, along side the work files, but I suppose thats not the *root" ? 



    ------------------------------
    Søren Arnvig
    Specialist IT Drift / Mainframe
    Topdanmark Edb II ApS
    Ballerup DK
    ------------------------------
    Lionel Dyck
    Participating Frequently
    Dec 8, 2022 9:05 AM UTC

    Thanks for the swift answer

    I'm not sure what "root" means in this context

    I have the .gitattributes in the main branch, along side the work files, but I suppose thats not the *root" ? 



    ------------------------------
    Søren Arnvig
    Specialist IT Drift / Mainframe
    Topdanmark Edb II ApS
    Ballerup DK
    ------------------------------

    My use of 'root' meant the main git repository directory where the files reside.

    This is a sample that may help:

    drwxrwxrwx 8 LBDYCK ZOWEDEV 8192 Sep 12 12:46 . 
    drwxrwxrwx 37 LBDYCK ZOWEDEV 8192 Dec 6 11:26 ..
    drwxrwxrwx 7 LBDYCK ZOWEDEV 8192 Dec 4 10:43 .git
    t ISO8859-1 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 511 Sep 12 12:46 .gitattributes
    drwxrwxrwx 3 LBDYCK ZOWEDEV 8192 Sep 12 12:46 .github
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Nov 15 06:54 .zigi
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 2299 Sep 12 12:46 README.md
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Nov 15 06:46 ZIGI.EXEC
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 35153 Sep 14 17:26 ZIGI.GPLLIC
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Sep 12 12:46 ZIGI.PANELS
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 1755 Sep 12 13:30 ZIGI.README
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 47950 Nov 30 15:14 ZIGI.RELEASE
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Sep 12 12:46 ZIGI.SAMPLES
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 1079 Sep 12 12:46 zginstall.readme
    t IBM-1047 T=on -rwxrwxrwx 1 LBDYCK ZOWEDEV 56426 Sep 12 12:46 zginstall.rex


    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------
    Søren Arnvig
    Participating Frequently
    Dec 9, 2022 5:50 AM UTC

    My use of 'root' meant the main git repository directory where the files reside.

    This is a sample that may help:

    drwxrwxrwx 8 LBDYCK ZOWEDEV 8192 Sep 12 12:46 . 
    drwxrwxrwx 37 LBDYCK ZOWEDEV 8192 Dec 6 11:26 ..
    drwxrwxrwx 7 LBDYCK ZOWEDEV 8192 Dec 4 10:43 .git
    t ISO8859-1 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 511 Sep 12 12:46 .gitattributes
    drwxrwxrwx 3 LBDYCK ZOWEDEV 8192 Sep 12 12:46 .github
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Nov 15 06:54 .zigi
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 2299 Sep 12 12:46 README.md
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Nov 15 06:46 ZIGI.EXEC
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 35153 Sep 14 17:26 ZIGI.GPLLIC
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Sep 12 12:46 ZIGI.PANELS
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 1755 Sep 12 13:30 ZIGI.README
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 47950 Nov 30 15:14 ZIGI.RELEASE
    drwxrwxrwx 2 LBDYCK ZOWEDEV 8192 Sep 12 12:46 ZIGI.SAMPLES
    t IBM-1047 T=on -rw-rw-rw- 1 LBDYCK ZOWEDEV 1079 Sep 12 12:46 zginstall.readme
    t IBM-1047 T=on -rwxrwxrwx 1 LBDYCK ZOWEDEV 56426 Sep 12 12:46 zginstall.rex


    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------
    All files are in the repository and the .gitattributes should reside in the same physical directory as the other files



    ------------------------------
    Søren Arnvig
    Specialist IT Drift / Mainframe
    Topdanmark Edb II ApS
    Ballerup DK
    ------------------------------