Q:

Check git repo access rights before performing the clone

I am using a make file to pull a repo then build. However, the project is also accessible by people who have no access to this repo and should be able to build other parts of the project.
Unfortunately now the build fails for whoever have no access to this specific git repo.
Is there a way I could check if the user has access to the git repo before cloning? This will allow me to skip that part in the make process without killing the build.

A:

This solved it for me:
GIT_SSH_COMMAND="ssh -oBatchMode=yes"

