Although this solution may not be an automation, but you can manually specify the folder name in which you want to clone your repository. Here's a way to do it:
git clone https://github.com/xyz/project1.git xyz/project1
This will clone your repository within xyz
directory, in the project1
sub-directory.