z/OS Tools & Language

Expand all | Collapse all

Git clone not working from remote

Archive User10-31-2016 01:21

  • 1.  Git clone not working from remote

    Posted 10-25-2016 08:07

    I did a few tests with git. Locally, all was fine.

    One problem: when creating a bare repository on z/OS, and then trying to clone it from my laptop I get.
    Cloning into ‘repos1’…
    bash: git-upload-pack: command not found
    fatal: Could not read from remote repository.

    When showing the path with
    ssh manfred@hostsystem ‘echo $PATH’

    I get
    /bin

    which seems to be the compiled path on the sshd server side.

    As a workaround I created symlinks of the git utilities in /bin but now I got

    fatal: protocol error: bad line length character: ����

    Perhaps I did a stupid mistake. If yes please enlighten me if not then my question: How do I configure the PATH variable so that I could clone from remote?


    Thanks, Manfred



  • 2.  RE: Git clone not working from remote

    Posted 10-27-2016 10:20

    Hi, Manfred.

    Git on z/OS does not work as a git server at this moment.

    Regards,
    Andrey



  • 3.  RE: Git clone not working from remote

    Posted 10-31-2016 01:21

    Hi Andrey, thanks for the info.



  • 4.  RE: Git clone not working from remote

    Posted 12-30-2016 13:38

    Manfred, I was having the same problem. I finally worked out how to get past that problem.

    I did not want to put all the git programs into the /bin programs. So the problem was how to get the the path changed in a non-login non-interactive shell (which is what gets generated to handle the request). /etc/profile and ~/.profile only get invoked from a login shell, so I couldn’t use those to set the path. .bashrc only gets invoked from a non-login interactive shell, so it did not do the trick by itself either.

    What I ended up needing to do was first modify the /etc/ssh/sshd_config file to uncomment and set

    PermitUserEnvironment yes

    which then allows you to have a ~/.ssh/environment file which contains

    BASH_ENV=~/.bashrc

    so now in a non-login non-interactive shell, you can get the ~/.bashrc (or any other script you put in the BASH_ENV variable above) to execute.

    In my ~/.bashrc I have

    export PATH=/usr/local/git/bin:$PATH

    which now got me access to the executables.

    Problem 1 solved, but I’m still running into a second problem that I have not overcome yet, perhaps because the product is not ready to run as a server yet.

    From my git repository on my windows machine I run

    git remote add myZOS ssh://myUser@myZOS.mydomain.com/u/myUser/mygit/myProduct
    git pull myZOS

    and get a response of

    fatal: protocol error: bad line length character: ▒▒▒
    Unable to write to standard output: The pipe is being closed.

    This often is related to a problem with a response of some error, so I used

    ssh myUser@myZOS.mydomain.com git-receive-pack /u/myUser/mygit/myProduct

    to verify. I was having a problem with the public key, Once I fixed that, I now get

    fatal: protocol error: bad line length character:

    followed by some junk… I haven’t gotten past that yet.



  • 5.  RE: Git clone not working from remote

    Posted 01-04-2017 10:16

    Hi Tim,
    In the end you are stuck where I was stuck, namely:
    fatal: protocol error: bad line length character:



  • 6.  RE: Git clone not working from remote

    Posted 11-06-2017 11:32

    Thanks a lot ,this solved it for me aswell



  • 7.  RE: Git clone not working from remote

    Posted 01-09-2017 09:46

    z/OS git does not currently work as a git server. It can pull from or push to other git servers, but not the other way around.



  • 8.  RE: Git clone not working from remote

    Posted 01-11-2017 09:36

    I am getting the error when also trying to clone my local repo. Should I think this because the same reason that z/OS git does not currently work as a server. If so, should I think “git clone” is a dummy command in z/OS git (at least for now.)

    command: git clone /u/ttg/coderepo/project1/.git /u/ttg/coderepo/project2
    error: cannot run git-upload-pack ‘/u/ttg/coderepo/project1/.git’: EDC5129I No such file or directory.
    fatal: unable to fork

    command: git clone /u/ttg/coderepo/project1 /u/ttg/coderepo/project2
    error: cannot run git-upload-pack ‘/u/ttg/coderepo/project1’: EDC5129I No such file or directory.
    fatal: unable to fork



  • 9.  RE: Git clone not working from remote

    Posted 01-11-2017 10:25

    cloning locally works fine for me



  • 10.  RE: Git clone not working from remote

    Posted 01-12-2017 05:33

    Hello Manfred.
    Can you give a sample git clone command you use for local clone. You mean from one directory in your local directory into another folder again in your directory? Or cloning a remore repository into a zos git folder…

    Thanks in advance.



  • 11.  RE: Git clone not working from remote

    Posted 01-12-2017 09:29

    Here is a shell session showing both a remote and local clone on z/OS. These same commands should work for you (assuming you have an account on github and ssh key configured):

    bash-2.03$ uname
    OS/390
    bash-2.03$ git clone git@github.com:zorts/hello_world.git
    Cloning into 'hello_world'...
    bash-2.03$ cd hello_world/
    bash-2.03$ make
    cc -c -o hello.o hello.c
    cc -o hello hello.o
    ./hello
    Hello, world!
    This command is ./hello, and it has 0 arguments
    ./hello with some arguments
    Hello, world!
    This command is ./hello, and it has 3 arguments
    [1]: with
    [2]: some
    [3]: arguments
    bash-2.03$ cd ..
    bash-2.03$ git clone hello_world new_hello_world
    git clone hello_world new_hello_world
    Cloning into 'new_hello_world'...
    done.
    bash-2.03$ cd new_hello_world/
    bash-2.03$ make
    cc -c -o hello.o hello.c
    cc -o hello hello.o
    ./hello
    Hello, world!
    This command is ./hello, and it has 0 arguments
    ./hello with some arguments
    Hello, world!
    This command is ./hello, and it has 3 arguments
    [1]: with
    [2]: some
    [3]: arguments
    bash-2.03$


  • 12.  RE: Git clone not working from remote

    Posted 01-13-2017 03:08

    bash-2.03$ git clone hello_world new_hello_world

    Should I open a seperate bash shell? I am connecting directly via putty, and using git commands. What I didn’t understand is other gir commands like init, add, status … works fine but git clone has driven me crazy. Whatever, thank you very much for your help but i think I got too much time of yours. Sorry for this.



  • 13.  RE: Git clone not working from remote

    Posted 01-13-2017 04:18

    Hello my problem is resolved when i tried with a clean directory which i created manually. I think the problem was related with my files in the repo. Thank you very much for this exciting tool in zos.



  • 14.  RE: Git clone not working from remote

    Posted 01-26-2017 03:06

    A bit late but here it is.

    Cloning locally: git clone /mygit/x.git. Directory x will be created containing the clone of x.git

    Or from gitlab: git clone git@gitlab.com:Lotz/manfred.git which works fine as well.



  • 15.  RE: Git clone not working from remote

    Posted 01-11-2017 11:11

    I have also tested cloning a local repo, and it works for me.

    If you just type “git-upload-pack” at the command prompt, what happens? The message you are getting seems to suggest that git-upload-pack isn’t being found.



  • 16.  RE: Git clone not working from remote

    Posted 01-12-2017 03:27

    Hello.
    When I type only git-upload-pack, the following message I get. I think it can’t find the repository, not the command itsef. I think i have made a mistake in installation. I am going to reinstall this time into my own users folder (/u/myuser) instead of /u/ptools/zosgit and try again.

    myuser:/u/ttg/coderepo/project1: >git-upload-pack
    usage: git upload-pack [–strict] [–timeout=]



  • 17.  RE: Git clone not working from remote

    Posted 05-30-2017 03:21

    Is it planned to support git as a server on z/OS UNIX?

    – Manfred



  • 18.  RE: Git clone not working from remote

    Posted 05-30-2017 08:47

    HI, Manfred. We do not currently plan to support git as a server on z/OS.



  • 19.  RE: Git clone not working from remote

    Posted 05-31-2017 02:18

    Hi Jerry,
    Thanks for the reply.

    I’m not currently sure if I would regard such a support terribly urgent as of course one could have a repository at github, gitlab or company internal github server. Then one could just clone from there.
    – Manfred



  • 20.  RE: Git clone not working from remote

    Posted 06-02-2017 14:21

    I stumbled onto this thread as I too was unsuccessfully trying to clone a repo from zOS git and I’m glad the lack of support was mentioned here as I can now move on to other tasks.

    I would like to mention though that the concept of using zOS git as a server is a powerful one. Using zOS git as a client limits the user to using only zOS supported editing tools which imposes hurdles when it comes to working a language like Java which is supported by the powerful Eclipse IDE.

    A hypothetical scenario that server support would allow is where a Java developer could clone a zOS git repo into Eclipse as a project and develop/debug Java code locally, then push to the remote on zOS, compile and run. I think this functionality would only further promote/demonstrate mainframe modernization.

    This scenario is of course still possible with an intermediate remote on a supported platform but adds an unnecessary extra step to the development process and requires extra overhead/infrastructure.

    Just my two cents.

    -Matt



  • 21.  RE: Git clone not working from remote

    Posted 06-02-2017 16:00

    Hi, Matt. I hear what you’re saying, but support for git as a server on z/OS is just not a high priority for us at this time.This has to do with the specifics of how ssh works on z/OS, and the need to port other libraries to z/OS to be able to support the other git protocols. It turns out to be a difficult problem.

    In addition, systems layered on top of git (such as github and BitBucket) provide very high-value functionality (notably pull requests and code review tools) that most git users will want anyway. We certainly use that functionality internally at Rocket.



  • 22.  RE: Git clone not working from remote

    Posted 06-02-2017 16:16

    Thanks for the additional information on why the server functionality is a tough implementation. It makes sense. Any dismay resulting in the lack of server support is far outweighed by the fact that git is available on zOS. I will certainly explore the use cases that you mentioned. We’re very excited to see what we can do with it.



  • 23.  RE: Git clone not working from remote

    Posted 06-30-2020 03:33

    Hi, I’m trying to setup git as a server on z/OS and I found this thread.
    Is this still true? No server mode?

    Thank you in advance
    Cris



  • 24.  RE: Git clone not working from remote

    Posted 06-30-2020 08:35

    Hi Cris,
    Currently we don’t have a plan to support git server on z.