Git clone fails from makefile

Viewed 295

I am on windows and I have to used makefile to clone a repository. So far simplified the case to:

TE_GIT=git@gitlab.someserver.com:te/te.git

all:
    git clone --branch $(TE_BRANCH) $(TE_GIT) TranslationEditor

running the clone command from cmd or powershell works fine.

running via

make -f Makefile.test

produces

Permission denied (publickey).

What I checked?

  1. my ssh-keys work and are added
  2. the same version of ssh is called from cmd and makescript
  3. the same command works from powershell script

Can you give me a hint what else I can check, investigate, try?

EDIT: using nmake works fine.

Somehow make does not use the proper environment.

1 Answers

Okay, in my case the problem was the location of "HOME".

Apparently nmake uses the windows env variables to search for identity files, "known_hosts" files and similar.

While make tries to search "HOME". If no such env variable it goes to c:\ (thus using c:.ssh...).

To fix it add temporarly or permanently (it is up to you):

Powershell:$env:home = $env:userprofile cmd: set(x) HOME *path to home*

Related