git pull if exist and clone

C++
if cd repo; then git pull; else git clone https://server/repo repo; fi

Source

Also in C++: