Pull specific file from a folder in a repo and save it at location X

Greetings guys,

I have a question about GIT. I have a private repo here on GitHub and I would like to automate via cronjob the distrobution of a single file from it. 

Basically I want to pull that specific file and put it into the home folder and overwrite existing file. 

The file is located in the private repo under FolderA/.file1q2

Can someone guide me how this can be archieved? Is creating a empty repo really necessary? Then I would rather just select a global location for that empty report anf afterwards jut move the file via mv to the location. 



There are a few different ways to achieve what you want, but yes, probably the easiest and most reliable would be to clone the repository (or pull the latest revision if you’ve already cloned it) and then copy the file you want to the location you want it to be in.

I hope that helps!


Hi Thanks for the reply, do you have the two other options handy? 

Otherwise I’ll probably really need to clone the repo?

The only one I have a handy link to is the sparse checkout technique.